/* 포근마을 — UI 스타일
   레이아웃: 세로 모바일 한 장(최대 480px)을 화면 가운데에 두고, 방 캔버스가 뒤를 가득 채운다.
   상단 바(이름·코인·알림) / 하단 탭(옷장·꾸미기·방문·상점·다이어리·더보기) / 하단 패널(시트)로 구성.
   하나의 낮 시간 파스텔 세계로 고정한 단일 테마 (어두운 모드 없음). */
:root {
  --cream: #fff7ee;
  --paper: #fffdf9;
  --ink: #3f2e26;
  --ink-soft: #6c5649;
  --line: #ecdcca;
  --peach: #ffd6c0;
  --peach-deep: #b8562e;
  --mint: #c8ecdb;
  --mint-deep: #23684f;
  --lav: #e3daf8;
  --lav-deep: #54438f;
  --rose: #c4486a;
  --rose-soft: #fde3ea;
  --butter: #ffe9ad;
  --shadow: 0 6px 18px rgba(92, 58, 40, 0.14);
  --font-display: "Jua", "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --top-h: 56px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: #f3e6d6 radial-gradient(circle at 1px 1px, rgba(184, 130, 90, 0.18) 1px, transparent 1.5px) 0 0 / 18px 18px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--lav-deep); outline-offset: 2px; }
[hidden] { display: none !important; }

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(120, 80, 50, 0.08), 0 10px 40px rgba(92, 58, 40, 0.18);
  user-select: none;
  -webkit-user-select: none;
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* ── 상단 바 ── */
#topbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t));
  padding: calc(8px + var(--safe-t)) 12px 8px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(to bottom, rgba(255, 247, 238, 0.96), rgba(255, 247, 238, 0.82));
  border-bottom: 1px solid rgba(236, 220, 202, 0.7);
}
.me-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
  background: none; border: 0; padding: 0; text-align: left;
}
.me-chip img { width: 38px; height: 38px; border-radius: 50%; background: var(--peach); border: 2px solid #fff; box-shadow: var(--shadow); flex: none; object-fit: cover; }
.me-chip .nm { font-family: var(--font-display); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip .sub { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip .txt { min-width: 0; display: flex; flex-direction: column; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px 0 8px; border-radius: 17px;
  background: var(--paper); border: 1px solid var(--line);
  font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 rgba(120, 80, 50, 0.08);
}
.coin { width: 20px; height: 20px; flex: none; }
.iconbtn {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  box-shadow: 0 2px 0 rgba(120, 80, 50, 0.08);
}
.iconbtn svg { width: 22px; height: 22px; }
.badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--rose); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  font-family: var(--font-display);
}

/* ── 방문 · 모드 띠 ── */
#modebar {
  position: absolute; left: 10px; right: 10px; top: calc(var(--top-h) + var(--safe-t) + 6px); z-index: 19;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 14px; border-radius: 16px;
  background: rgba(255, 253, 249, 0.95); border: 1px solid var(--line); box-shadow: var(--shadow);
}
#modebar .t { flex: 1; min-width: 0; }
#modebar .t b { font-family: var(--font-display); font-weight: 400; font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#modebar .t span { font-size: 12px; color: var(--ink-soft); }

/* ── 첫걸음 안내 ── */
#guide {
  position: absolute; left: 10px; right: 10px; z-index: 21;
  top: calc(var(--top-h) + var(--safe-t) + 6px);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 12px; border-radius: 16px;
  background: #fffaf0; border: 2px solid #f1c96b; box-shadow: var(--shadow);
  font-size: 14px;
}
#guide.with-mode { top: calc(var(--top-h) + var(--safe-t) + 70px); }
#guide .step { font-family: var(--font-display); color: #8a5a12; font-size: 13px; white-space: nowrap; }
#guide .msg { flex: 1; min-width: 0; }
#guide.mini { left: auto; right: 10px; padding: 6px 10px; }
#guide.mini .msg { display: none; }
.pulse { animation: pulse 1.4s ease-in-out infinite; position: relative; z-index: 2; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 201, 107, 0.0); }
  50% { box-shadow: 0 0 0 7px rgba(241, 201, 107, 0.65); }
}

/* ── 떠 있는 버튼 ── */
.fabs {
  position: absolute; right: 12px; z-index: 18;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.fab {
  display: flex; align-items: center; gap: 6px;
  height: 48px; min-width: 48px; padding: 0 14px; border-radius: 24px;
  border: 0; background: var(--paper); box-shadow: var(--shadow);
  font-family: var(--font-display); font-size: 15px;
}
.fab svg { width: 24px; height: 24px; }
.fab.primary { background: var(--rose); color: #fff; }
.fab .ring { font-size: 12px; color: var(--ink-soft); font-family: var(--font-body); }
.fab.gift { background: #fff3c9; border: 2px solid #f1c96b; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ── 하단 탭 ── */
#nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(92, 58, 40, 0.08);
}
#nav button, .navlike button {
  border: 0; background: none; padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12.5px; color: var(--ink);
  min-height: 44px; border-radius: 14px;
}
#nav button svg, .navlike button svg { width: 26px; height: 26px; }
#nav button:active, .navlike button:active { background: var(--rose-soft); }
.navlike {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--paper); border-top: 1px solid var(--line);
}

/* ── 하단 패널 ── */
#sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  height: var(--sheet-h, 50%);
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(92, 58, 40, 0.18);
  padding-bottom: var(--safe-b);
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0.4; } }
.sh-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px 18px; }
.sh-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 10px; }
.sh-foot { display: flex; gap: 8px; padding: 8px 14px 10px; border-top: 1px solid var(--line); align-items: center; }
.sh-foot .spacer { flex: 1; }

.tabs { display: flex; gap: 6px; padding: 0 14px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--cream); font-size: 14px;
}
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--line); background: #fff; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip[aria-pressed="true"] { background: var(--lav); border-color: #b9a8ea; color: var(--lav-deep); font-weight: 700; }
.chip.theme-sun[aria-pressed="true"] { background: #fbe7bf; border-color: #e9c27a; color: #6e4a17; }
.chip.theme-berry[aria-pressed="true"] { background: #ffd9e1; border-color: #f0a3b4; color: #8f2f49; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 7px; border-radius: 14px; min-width: 0;
  border: 1.5px solid var(--line); background: #fff; text-align: center;
}
.card img { width: 72px; height: 72px; display: block; }
.card .nm { font-size: 12px; line-height: 1.25; width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 30px; }
.card .meta { font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.card.on { border-color: var(--rose); background: var(--rose-soft); }
.card.locked img { opacity: 0.55; filter: saturate(0.6); }
.card .tag { position: absolute; top: 4px; left: 4px; font-size: 10.5px; padding: 1px 6px; border-radius: 8px; background: var(--ink); color: #fff; }
.card .tag.lock { background: #8b7b70; }
.card .tag.prev { background: var(--lav-deep); }
.card .cnt { position: absolute; top: 4px; right: 5px; font-size: 11px; font-family: var(--font-display); color: var(--ink-soft); }
.card:disabled { opacity: 0.5; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }

.infobar {
  display: flex; align-items: center; gap: 10px; margin: 0 14px 6px; padding: 8px 10px;
  border-radius: 14px; background: var(--cream); border: 1px dashed #dcc6b0; font-size: 13px; min-height: 44px;
}
.infobar img { width: 36px; height: 36px; }
.infobar .t { flex: 1; min-width: 0; }
.infobar b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.infobar span { color: var(--ink-soft); font-size: 12px; }

/* ── 버튼 ── */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff;
  font-family: var(--font-display); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.mint { background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.busy { pointer-events: none; opacity: 0.7; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 꾸미기 도구 ── */
.toolrow {
  position: absolute; left: 10px; right: 10px; z-index: 31;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  border-radius: 16px; background: rgba(255, 253, 249, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.toolrow .t { flex: 1; min-width: 0; font-size: 13px; padding-left: 6px; }
.toolrow .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolrow .t .bad { color: var(--rose); }
.toolrow .t .good { color: var(--mint-deep); }
.tbtn {
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; gap: 0;
}
.tbtn svg { width: 20px; height: 20px; }
.tbtn:disabled { opacity: 0.4; }

/* ── 전체 화면 페이지 ── */
#page {
  position: absolute; inset: 0; z-index: 40; background: var(--cream);
  display: flex; flex-direction: column;
  animation: fadein 0.18s ease-out;
}
@keyframes fadein { from { opacity: 0; } }
.pg-head {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.pg-head h1 { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 21px; min-width: 0; }
.pg-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); }
.section { margin-bottom: 18px; }
.section > h3 { font-family: var(--font-display); font-weight: 400; font-size: 17px; margin: 0 0 8px; }
.note { font-size: 13px; color: var(--ink-soft); background: var(--paper); border: 1px dashed #dcc6b0; border-radius: 12px; padding: 10px 12px; }
.note.demo { background: var(--lav); border: 1px solid #cfc2f1; color: var(--lav-deep); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 52px;
  border-radius: 14px; background: var(--paper); border: 1px solid var(--line);
}
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-size: 15px; }
.row .t span { font-size: 12.5px; color: var(--ink-soft); }
.row .num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.row .num.plus { color: var(--mint-deep); }
.row .num.minus { color: var(--rose); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: #d9cbbf; transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch input:checked + span { background: var(--mint-deep); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--lav-deep); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 0 12px; min-height: 38px; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-soft); }
.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-size: 16px; user-select: text; -webkit-user-select: text;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: #b9a8ea; outline: none; box-shadow: 0 0 0 3px var(--lav); }
.counter { font-size: 12px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.err { color: var(--rose); font-size: 13px; min-height: 18px; }

/* ── 모달 ── */
#modal {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(63, 46, 38, 0.38); padding: 16px;
  animation: fadein 0.15s ease-out;
}
.dialog {
  width: 100%; max-width: 380px; max-height: 92%; overflow-y: auto;
  background: var(--paper); border-radius: 20px; padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.dialog h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.dialog p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14.5px; }
.dialog .acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dialog .acts.row2 { flex-direction: row; }
.dialog .acts.row2 .btn { flex: 1; }
.dialog img.big { width: 140px; height: 140px; display: block; margin: 4px auto 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 8px 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-display); }

/* ── 토스트 ── */
#toasts {
  position: absolute; left: 0; right: 0; top: calc(var(--top-h) + var(--safe-t) + 8px); z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px;
}
#modebar:not([hidden]) ~ #toasts, #guide:not([hidden]):not(.mini) ~ #toasts { top: calc(var(--top-h) + var(--safe-t) + 74px); }
#modebar:not([hidden]) ~ #guide:not([hidden]):not(.mini) ~ #toasts { top: calc(var(--top-h) + var(--safe-t) + 138px); }
.toast {
  max-width: 100%; padding: 10px 16px; border-radius: 16px;
  background: rgba(63, 46, 38, 0.92); color: #fff; font-size: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px; animation: toastin 0.2s ease-out;
}
.toast img { width: 26px; height: 26px; }
.toast.good { background: rgba(35, 104, 79, 0.95); }
.toast.warn { background: rgba(160, 52, 82, 0.95); }
@keyframes toastin { from { transform: translateY(-8px); opacity: 0; } }

/* ── 획득 연출 ── */
#getfx {
  position: absolute; inset: 0; z-index: 65; display: grid; place-items: center;
  background: rgba(63, 46, 38, 0.45);
}
.getbox { position: relative; text-align: center; width: min(320px, 86%); }
.getbox .rays {
  position: absolute; left: 50%; top: 92px; width: 320px; height: 320px; margin: -160px 0 0 -160px;
  background: repeating-conic-gradient(rgba(255, 233, 173, 0.55) 0 10deg, transparent 10deg 24deg);
  border-radius: 50%; animation: spin 9s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
}
.getbox .card2 { position: relative; background: var(--paper); border-radius: 22px; padding: 18px 16px 16px; box-shadow: var(--shadow); margin-top: 40px; }
.getbox img { width: 132px; height: 132px; animation: popin 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.getbox h2 { font-family: var(--font-display); font-weight: 400; margin: 4px 0 2px; font-size: 21px; }
.getbox .lbl { font-family: var(--font-display); color: #8a5a12; font-size: 15px; }
@keyframes popin { from { transform: scale(0.3) rotate(-12deg); opacity: 0; } }

/* ── 사진 모드 ── */
.photo-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 32;
  padding: calc(10px + var(--safe-t)) 12px 8px; display: flex; align-items: center; gap: 8px;
}
.photo-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 32;
  padding: 10px 12px calc(12px + var(--safe-b));
  background: rgba(255, 253, 249, 0.95); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px rgba(92, 58, 40, 0.16);
  display: flex; flex-direction: column; gap: 8px;
}
.shutter {
  width: 68px; height: 68px; border-radius: 50%; border: 5px solid #fff; background: var(--rose);
  box-shadow: 0 0 0 2px var(--rose), var(--shadow); flex: none;
}
.shutter:active { transform: scale(0.94); }
.zoomrow { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.zoomrow input[type="range"] { flex: 1; accent-color: var(--rose); height: 30px; }

/* ── 다이어리 ── */
.post { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.post .ph { width: 100%; aspect-ratio: 3 / 4; max-width: 100%; background: #f1e7da; display: block; object-fit: cover; }
.post .bd { padding: 10px 12px 12px; }
.post .bd p { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.post .mt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.post .mt .sp { flex: 1; }
.vis { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; background: var(--mint); color: var(--mint-deep); }
.vis.friends { background: var(--peach); color: var(--peach-deep); }
.vis.private { background: #ece4dc; color: var(--ink-soft); }
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #f1e7da; aspect-ratio: 3 / 4; }
.album button[aria-pressed="true"] { border-color: var(--rose); }
.album img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed { display: flex; flex-direction: column; gap: 14px; }

/* ── 방문 목록 ── */
.res { display: flex; gap: 12px; padding: 12px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.res img { width: 76px; height: 76px; border-radius: 16px; background: var(--rose-soft); flex: none; }
.res .t { flex: 1; min-width: 0; }
.res .t b { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.res .t p { margin: 2px 0 6px; font-size: 13px; color: var(--ink-soft); }
.res .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tagx { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--lav); color: var(--lav-deep); margin-left: 4px; vertical-align: 2px; }
.tagx.theme { background: var(--butter); color: #6e4a17; }

/* ── 생성 화면 ── */
.create-stage { position: relative; height: 34vh; min-height: 200px; display: grid; place-items: center; background: radial-gradient(circle at 50% 70%, #fff 0, #fbe9da 60%, #f6dcc8 100%); }
.create-stage canvas { width: 220px; height: 100%; }
.optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; min-height: 64px; justify-content: center; }
.opt img { width: 54px; height: 54px; }
.opt[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); }

.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #dcc6b0; display: grid; place-items: center; background: #fff; }
.stamp.on { border: 2px solid var(--rose); background: var(--rose-soft); }
.stamp svg { width: 60%; height: 60%; }
.progress { height: 10px; border-radius: 5px; background: #efe3d6; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #f1c96b, #e98b6d); border-radius: 5px; }

.livebar {
  position: absolute; left: 8px; right: 8px; z-index: 22;
  bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  border-radius: 16px; background: rgba(255, 253, 249, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.livebar.guest { bottom: calc(var(--safe-b) + 10px); }
.livebar .input { min-height: 40px; padding: 6px 10px; }
.livechat {
  position: absolute; left: 10px; z-index: 21; max-width: 72%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 70px);
  display: flex; flex-direction: column; gap: 3px; pointer-events: none;
}
.livechat.guest { bottom: calc(var(--safe-b) + 72px); }
.livechat .line { background: rgba(63, 46, 38, 0.72); color: #fff; font-size: 13px; padding: 4px 9px; border-radius: 10px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.livechat .line b { font-weight: 700; color: #ffe9ad; }
.roomcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.roomcard .faces { display: flex; flex: none; }
.roomcard .faces img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--rose-soft); margin-left: -8px; }
.roomcard .faces img:first-child { margin-left: 0; }
.roomcard .t { flex: 1; min-width: 0; }
.roomcard .t b { font-family: var(--font-display); font-weight: 400; font-size: 17px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomcard .t span { font-size: 12.5px; color: var(--ink-soft); }
.perf {
  position: absolute; left: 8px; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 50;
  font: 11px/1.4 ui-monospace, Consolas, monospace; background: rgba(40, 30, 25, 0.8); color: #fff; padding: 6px 8px; border-radius: 8px; pointer-events: none; white-space: pre;
}
.pop {
  position: absolute; z-index: 35; display: flex; gap: 6px; padding: 6px; border-radius: 16px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (min-width: 700px) {
  body { padding-block: 12px; }
  #app { border-radius: 22px; height: calc(100% - 24px); }
}
