/* ---------------------------------------------------------------------------
   동네 — 화면 스타일

   색은 2000년대 초 한국 골목에서 그대로 가져왔다.
   시멘트 담, 붉은 벽돌, 옥상 방수 페인트 초록, 나트륨 가로등의 노란빛.
   강조색은 오직 나트륨등 하나. 나머지는 전부 조용하게 둔다.
--------------------------------------------------------------------------- */

:root {
  --night:    #1e2430;
  --night-2:  #262d3b;
  --night-3:  #323a4a;
  --paper:    #f4efe4;
  --paper-dim:#c8c2b4;
  --mute:     #838b9c;
  --sodium:   #f0b858;
  --sodium-d: #c9903c;
  --brick:    #a85c46;
  --roof:     #4e7a63;
  --ginkgo:   #e8c34a;
  --danger:   #d4756a;

  --sans: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', system-ui, sans-serif;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;

  --r-s: 8px;
  --r-m: 13px;
  --r-l: 20px;

  --kb: 0px;          /* 자판이 가린 높이 */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 을 붙였는데도 .panel 같은 데 걸린 display 지정이 이겨 버려서
   닫기 단추가 먹지 않았다. 여기서 확실히 눌러 둔다. */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  overscroll-behavior: none;
  touch-action: none;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

/* --- 접속 화면 ----------------------------------------------------------- */

.gate {
  position: fixed; inset: 0; display: flex; align-items: flex-end;
  padding: 0 24px calc(40px + var(--safe-b));
  background: linear-gradient(to top, rgba(20,25,34,.94) 0%, rgba(20,25,34,.7) 42%, rgba(20,25,34,0) 78%);
  animation: gate-in .9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }

.gate-inner { width: 100%; max-width: 340px; }

.gate-place {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .18em;
  color: var(--mute);
}
.gate-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(46px, 13vw, 62px); line-height: .95;
  margin: 0 0 18px; letter-spacing: -.02em;
  text-shadow: 0 2px 30px rgba(240,184,88,.22);
}
.gate-lead {
  font-family: var(--serif); font-size: 16px; line-height: 1.85;
  color: var(--paper-dim); margin: 0 0 30px;
}

.gate-form { display: grid; gap: 12px; }

.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--mute); letter-spacing: .02em; }
.field input {
  width: 100%; padding: 14px 15px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--r-m);
  outline: none;
  transition: border-color .18s, background .18s;
}
.field input::placeholder { color: #6d7486; }
.field input:focus {
  border-color: var(--sodium);
  background: rgba(240,184,88,.09);
}

.btn-primary {
  padding: 15px; border-radius: var(--r-m);
  background: var(--sodium); color: #26211a;
  font-weight: 700; font-size: 16px;
  transition: transform .12s cubic-bezier(.3,1.4,.5,1), filter .18s;
}
.btn-primary:active { transform: scale(.975); }
.btn-primary:disabled { filter: grayscale(.6) brightness(.75); cursor: default; }
.btn-small { padding: 10px 16px; font-size: 14px; border-radius: var(--r-s); }

.btn-ghost {
  padding: 13px 18px; border-radius: var(--r-m);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  font-weight: 600; transition: border-color .18s, background .18s;
}
.btn-ghost:hover { border-color: var(--sodium); }

.btn-text {
  margin-top: 18px; color: var(--mute); font-size: 13.5px;
  text-decoration: underline; text-underline-offset: 4px;
}
.btn-text:hover { color: var(--paper); }

.gate-msg { min-height: 20px; margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--danger); }
.gate-msg.ok { color: var(--sodium); }

.gate-wait { animation: gate-in .5s ease both; }
.lamp {
  width: 44px; height: 44px; margin-bottom: 20px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #ffe6a8 0%, var(--sodium) 40%, rgba(240,184,88,0) 72%);
  animation: lamp 3.6s ease-in-out infinite;
}
@keyframes lamp { 0%,100% { opacity:.65; transform: scale(1);} 50% { opacity:1; transform: scale(1.09);} }

.wait-title { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.wait-lead { font-size: 14.5px; line-height: 1.85; color: var(--paper-dim); margin: 0 0 22px; }
.wait-lead b { color: var(--sodium); font-weight: 600; }

.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; padding: 13px 15px; letter-spacing: .3em; text-align: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--r-m); outline: none;
}
.code-row input:focus { border-color: var(--sodium); }

/* --- HUD ----------------------------------------------------------------- */

#game { position: fixed; inset: 0; pointer-events: none; }
#game > * { pointer-events: auto; }

.hud-top {
  position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

.glass {
  background: rgba(30,36,48,.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.09);
}

.card-me {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 7px; border-radius: 999px;
  background: rgba(30,36,48,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.09);
  text-align: left; transition: border-color .2s;
}
.card-me:hover { border-color: rgba(240,184,88,.4); }

.ring { position: relative; width: 38px; height: 38px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: rgba(255,255,255,.12); }
.ring-fill {
  stroke: var(--sodium); stroke-linecap: round;
  stroke-dasharray: 106.8; stroke-dashoffset: 106.8;
  transition: stroke-dashoffset .7s cubic-bezier(.16,1,.3,1);
}
.ring b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.me-text { display: grid; line-height: 1.28; }
.me-text b { font-size: 14.5px; font-weight: 600; }
.me-text em { font-style: normal; font-size: 11.5px; color: var(--mute); }

.card-won {
  display: flex; align-items: baseline; gap: 3px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(30,36,48,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.09);
}
.card-won b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--sodium); }
.card-won span { font-size: 11.5px; color: var(--mute); }

.place-tag {
  position: absolute; top: calc(70px + var(--safe-t)); left: 0; right: 0;
  text-align: center; font-family: var(--serif); font-size: 15px;
  color: rgba(244,239,228,.55); letter-spacing: .22em;
  opacity: 0; transition: opacity .8s ease; pointer-events: none;
}
.place-tag.show { opacity: 1; }

/* 방치 수익 카드 */
.idle-card {
  position: absolute; left: 12px; right: 12px; bottom: calc(96px + var(--safe-b));
  max-width: 340px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 18px; border-radius: var(--r-m);
  background: rgba(30,36,48,.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(240,184,88,.3);
  animation: rise .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px);} to { opacity:1; transform:none; } }
.idle-text { display: grid; line-height: 1.35; }
.idle-text b { font-size: 18px; color: var(--sodium); font-variant-numeric: tabular-nums; }
.idle-text em { font-style: normal; font-size: 12px; color: var(--mute); font-family: var(--serif); }

/* 채팅 */
.say-bar {
  position: absolute; left: 12px; right: 12px; bottom: calc(96px + var(--safe-b));
  max-width: 460px; margin: 0 auto; display: flex; gap: 8px;
  animation: rise .35s cubic-bezier(.16,1,.3,1) both;
}
.say-bar input {
  flex: 1; padding: 13px 16px; border-radius: var(--r-m); outline: none;
  background: rgba(30,36,48,.9); border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.say-bar input:focus { border-color: var(--sodium); }

/* 아래 버튼 줄 */
.dock {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b));
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: rgba(30,36,48,.76);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.09);
}
.dock-btn {
  display: grid; justify-items: center; gap: 3px;
  padding: 8px 15px; border-radius: 999px; color: var(--mute);
  transition: color .2s, background .2s;
}
.dock-btn span { font-size: 11px; font-weight: 600; }
.dock-btn i { width: 20px; height: 20px; display: block; background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain; }
.dock-btn:hover { color: var(--paper-dim); }
.dock-btn.on { color: #26211a; background: var(--sodium); }

/* 아이콘: 인라인 SVG 마스크 (이미지 파일 없이) */
i[data-i="work"] { -webkit-mask-image: var(--i-work); mask-image: var(--i-work); }
i[data-i="home"] { -webkit-mask-image: var(--i-home); mask-image: var(--i-home); }
i[data-i="shop"] { -webkit-mask-image: var(--i-shop); mask-image: var(--i-shop); }
i[data-i="board"]{ -webkit-mask-image: var(--i-board); mask-image: var(--i-board); }
i[data-i="say"]  { -webkit-mask-image: var(--i-say); mask-image: var(--i-say); }
i[data-i="face"] { -webkit-mask-image: var(--i-face); mask-image: var(--i-face); }
:root {
  --i-work: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='7' width='19' height='13' rx='2'/%3E%3Cpath d='M8.5 7V5.5a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2V7'/%3E%3Cpath d='M2.5 12h19'/%3E%3C/svg%3E");
  --i-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V20h14V9.5'/%3E%3Cpath d='M10 20v-5.5h4V20'/%3E%3C/svg%3E");
  --i-shop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8h17l-1 12h-15z'/%3E%3Cpath d='M8 8V6a4 4 0 0 1 8 0v2'/%3E%3C/svg%3E");
  --i-board:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='14' rx='2'/%3E%3Cpath d='M7 8.5h6M7 12.5h10'/%3E%3Cpath d='M9 18v2M15 18v2'/%3E%3C/svg%3E");
  --i-face: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8.5 14.5a4.5 4.5 0 0 0 7 0'/%3E%3Cpath d='M9 9.5v.01M15 9.5v.01'/%3E%3C/svg%3E");
  --i-say:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 12.5c0 4-3.8 7-8.5 7-1 0-2-.15-2.9-.42L4 21l1.2-3.6C4.1 16.1 3.5 14.4 3.5 12.5c0-4 3.8-7 8.5-7s8.5 3 8.5 7z'/%3E%3C/svg%3E");
}

/* --- 패널 ---------------------------------------------------------------- */

.panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 76vh; display: flex; flex-direction: column;
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: rgba(28,34,45,.94);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border-top: 1px solid rgba(255,255,255,.11);
  box-shadow: 0 -18px 50px rgba(0,0,0,.45);
  animation: sheet .4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes sheet { from { transform: translateY(102%); } to { transform: none; } }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 12px; flex: none;
}
.panel-head h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 700; }
.btn-close {
  width: 34px; height: 34px; border-radius: 50%; position: relative;
  background: rgba(255,255,255,.07); transition: background .2s;
}
.btn-close:hover { background: rgba(255,255,255,.14); }
.btn-close::before, .btn-close::after {
  content: ''; position: absolute; left: 11px; top: 16px; width: 12px; height: 1.6px;
  background: var(--paper-dim); border-radius: 2px;
}
.btn-close::before { transform: rotate(45deg); }
.btn-close::after { transform: rotate(-45deg); }

.panel-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 20px calc(24px + var(--safe-b));
}

/* 직업 카드 */
.job {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 14px;
  align-items: center; padding: 15px 16px 15px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.job:last-child { border-bottom: 0; }
.job-bar { width: 4px; align-self: stretch; border-radius: 3px; min-height: 44px; }
.job h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.job p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--mute); font-family: var(--serif); }
.job .rate { color: var(--sodium); font-family: var(--sans); font-size: 12px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.tag { font-size: 10.5px; padding: 2.5px 7px; border-radius: 5px; font-weight: 600; }
.tag.now { background: var(--sodium); color: #26211a; }
.tag.lock { background: rgba(255,255,255,.09); color: var(--mute); }
.job.locked { opacity: .5; }

.act {
  display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap;
}
.act button {
  flex: 1 1 140px; padding: 12px 14px; border-radius: var(--r-s); text-align: left;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.045);
  transition: border-color .2s, background .2s;
}
.act button:hover:not(:disabled) { border-color: var(--sodium); background: rgba(240,184,88,.09); }
.act button:disabled { opacity: .45; cursor: default; }
.act b { display: block; font-size: 14px; margin-bottom: 3px; }
.act em { font-style: normal; font-size: 11.5px; color: var(--mute); font-family: var(--serif); }

.section-note {
  font-family: var(--serif); font-size: 13.5px; line-height: 1.85;
  color: var(--paper-dim); margin: 0 0 18px;
  padding-left: 13px; border-left: 2px solid rgba(240,184,88,.4);
}

/* 상점 격자 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
.good {
  padding: 14px; border-radius: var(--r-m);
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.035);
  display: grid; gap: 6px; align-content: start;
  transition: border-color .2s, transform .18s;
}
.good:hover { border-color: rgba(240,184,88,.42); transform: translateY(-2px); }
.good .swatch { width: 100%; height: 40px; border-radius: var(--r-s); }
.good b { font-size: 14px; font-weight: 600; }
.good em { font-style: normal; font-size: 11.5px; color: var(--mute); font-family: var(--serif); line-height: 1.55; }
.good .price { font-size: 13px; color: var(--sodium); font-variant-numeric: tabular-nums; }
.good button { margin-top: 4px; padding: 9px; border-radius: var(--r-s);
  background: rgba(255,255,255,.08); font-size: 13px; font-weight: 600; transition: background .2s; }
.good button:hover:not(:disabled) { background: var(--sodium); color: #26211a; }
.good button:disabled { opacity: .4; cursor: default; }

/* 목록 */
.rows { display: grid; gap: 1px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px;
}
.row em { font-style: normal; color: var(--mute); font-size: 12.5px; }
.row .num { color: var(--sodium); font-variant-numeric: tabular-nums; }

/* 외모 고르기 */
.picker { display: grid; gap: 16px; }
.picker .line { display: grid; gap: 8px; }
.picker .line > span { font-size: 12.5px; color: var(--mute); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  width: 34px; height: 34px; border-radius: 9px;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
}
.chip.on { border-color: var(--sodium); transform: scale(1.1); }

/* --- 알림 --------------------------------------------------------------- */

.toasts {
  position: absolute; left: 0; right: 0; top: calc(120px + var(--safe-t));
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
}
.toast {
  max-width: min(88vw, 400px);
  padding: 12px 18px; border-radius: 999px;
  background: rgba(30,36,48,.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.11);
  font-family: var(--serif); font-size: 14px; line-height: 1.5; text-align: center;
  animation: toast 4.2s cubic-bezier(.16,1,.3,1) both;
}
.toast.gain { border-color: rgba(240,184,88,.5); }
.toast.gain b { color: var(--sodium); font-family: var(--sans); }
@keyframes toast {
  0% { opacity: 0; transform: translateY(-10px) scale(.96); }
  9%,84% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6px); }
}

.hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-b));
  font-family: var(--serif); font-size: 13px; color: rgba(244,239,228,.62);
  opacity: 0; transition: opacity .35s; pointer-events: none; white-space: nowrap;
}
.hint.show { opacity: 1; }

/* --- 넓은 화면 ---------------------------------------------------------- */

@media (min-width: 860px) {
  .gate { align-items: center; padding-left: 8vw; }
  .gate-inner { max-width: 380px; }

  .panel {
    left: auto; right: 16px; bottom: 16px; top: 16px;
    width: 420px; max-height: none; border-radius: var(--r-l);
    border: 1px solid rgba(255,255,255,.11);
    animation: sheet-side .42s cubic-bezier(.16,1,.3,1) both;
  }
  @keyframes sheet-side { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

  .idle-card, .say-bar { left: 16px; right: auto; margin: 0; width: 340px; }
  .toasts { top: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* --- 가구 배치 --------------------------------------------------------- */

.place-bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-b));
  display: flex; align-items: center; gap: 6px;
  padding: 7px 7px 7px 16px; border-radius: 999px;
  background: rgba(30,36,48,.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(240,184,88,.42);
  animation: rise .3s cubic-bezier(.16,1,.3,1) both;
  white-space: nowrap;
}
.place-bar > span {
  font-family: var(--serif); font-size: 14px; margin-right: 6px; color: var(--sodium);
}
.place-bar button {
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.09); transition: background .18s, color .18s;
}
.place-bar button:hover { background: var(--sodium); color: #26211a; }
#place-cancel { background: transparent; color: var(--mute); }
#place-cancel:hover { background: rgba(255,255,255,.09); color: var(--paper); }

/* 패널 안 하위 화면으로 넘어가는 단추 */
.subnav {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
}
.btn-sub {
  flex: 1; padding: 13px 16px; border-radius: var(--r-m); text-align: left;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.045);
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color .2s, background .2s;
}
.btn-sub:hover { border-color: var(--sodium); background: rgba(240,184,88,.08); }
.btn-sub b { font-size: 14.5px; font-weight: 600; }
.btn-sub em { font-style: normal; font-size: 12px; color: var(--mute); font-family: var(--serif); }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 14px; padding: 8px 14px 8px 10px; border-radius: 999px;
  background: rgba(255,255,255,.07); font-size: 13px; color: var(--paper-dim);
}
.btn-back:hover { background: rgba(255,255,255,.13); color: var(--paper); }
.btn-back::before { content: ''; width: 7px; height: 7px; border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-left: 4px; }

/* 가게 인사말 */
.shop-hello {
  font-family: var(--serif); font-size: 14px; line-height: 1.8;
  color: var(--paper-dim); margin: 0 0 18px; padding: 14px 16px;
  border-radius: var(--r-m); background: rgba(255,255,255,.045);
  border-left: 3px solid var(--sodium);
}

/* 가진 가구 목록의 놓기 단추 */
.good.placed { border-color: rgba(240,184,88,.35); }
.good .size { font-size: 11.5px; color: var(--mute); }


/* --- 근무 미니게임 ------------------------------------------------------ */

.mini-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: rgba(16,20,28,.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: gate-in .28s ease both;
  --mini-accent: var(--sodium);
}
.mini-overlay .mini-card {
  position: relative; width: 100%; max-width: 400px;
  padding: 30px 26px 26px; border-radius: var(--r-l);
  background: rgba(28,34,45,.97);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  text-align: center;
  animation: rise .38s cubic-bezier(.16,1,.3,1) both;
}
.mini-overlay .btn-close { position: absolute; top: 14px; right: 14px; }
.mini-place { margin: 0 0 4px; font-size: 12px; letter-spacing: .16em; color: var(--mute); }
.mini-title { margin: 0 0 10px; font-family: var(--serif); font-size: 25px; font-weight: 700; }
.mini-desc { margin: 0 0 22px; font-family: var(--serif); font-size: 14px;
  line-height: 1.75; color: var(--paper-dim); }

.mini-rounds { display: flex; justify-content: center; gap: 7px; margin-bottom: 18px; }
.mini-rounds span {
  width: 26px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14);
  transition: background .3s;
}
.mini-rounds span.good { background: var(--mini-accent); }
.mini-rounds span.ok { background: rgba(240,184,88,.5); }
.mini-rounds span.bad { background: var(--danger); }

.mini-bar {
  position: relative; height: 46px; margin-bottom: 20px;
  border-radius: var(--r-s); overflow: hidden; cursor: pointer;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.mini-zone {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg,
    rgba(240,184,88,.15), rgba(240,184,88,.45), rgba(240,184,88,.15));
  border-left: 1px solid rgba(240,184,88,.55);
  border-right: 1px solid rgba(240,184,88,.55);
  transition: left .28s ease, width .28s ease;
}
.mini-cursor {
  position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px;
  border-radius: 2px; background: var(--paper);
  box-shadow: 0 0 12px rgba(244,239,228,.7);
}
.mini-log {
  min-height: 22px; margin: 14px 0 0;
  font-family: var(--serif); font-size: 14px; color: var(--mini-accent);
}
.mini-card .btn-primary { width: 100%; }

/* --- 관리 화면 ---------------------------------------------------------- */

.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.07);
}
.admin-row .who { display: grid; line-height: 1.4; min-width: 0; }
.admin-row .who b { font-size: 14.5px; font-weight: 600; }
.admin-row .who em {
  font-style: normal; font-size: 11.5px; color: var(--mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-danger {
  padding: 8px 14px; border-radius: var(--r-s); font-size: 13px; font-weight: 600;
  background: rgba(212,117,106,.15); color: var(--danger);
  border: 1px solid rgba(212,117,106,.35); transition: background .2s, color .2s;
}
.btn-danger:hover { background: var(--danger); color: #2b1e1c; }
.btn-danger:disabled { opacity: .35; cursor: default; }
.admin-warn {
  font-family: var(--serif); font-size: 13px; line-height: 1.8;
  color: var(--danger); margin: 0 0 16px; padding: 13px 15px;
  border-radius: var(--r-m); background: rgba(212,117,106,.1);
  border-left: 3px solid var(--danger);
}


/* --- 자판이 올라왔을 때 -------------------------------------------------- */
/* 대화창은 자판 바로 위에 붙이고, 방해되는 것들은 잠시 치운다. */

.say-bar {
  bottom: calc(var(--kb) + 14px + var(--safe-b));
  transition: bottom .18s ease;
}
body.kb-open .dock,
body.kb-open .idle-card,
body.kb-open .hud-top,
body.kb-open .place-tag { opacity: 0; pointer-events: none; }
body.kb-open .dock,
body.kb-open .idle-card,
body.kb-open .hud-top,
body.kb-open .place-tag { transition: opacity .18s ease; }
body.kb-open .toasts { top: calc(24px + var(--safe-t)); }

/* 자판이 올라온 동안에는 대화창이 화면 폭을 다 쓴다 */
@media (max-width: 859px) {
  body.kb-open .say-bar { left: 10px; right: 10px; }
}


/* --- 방향 돌리기 -------------------------------------------------------- */

.compass {
  position: absolute; right: 12px; top: calc(74px + var(--safe-t));
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 999px;
  background: rgba(30,36,48,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.09);
}
.compass button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; color: var(--paper-dim); transition: background .18s, color .18s;
}
.compass button:hover { background: rgba(240,184,88,.18); color: var(--sodium); }
.compass button:active { transform: scale(.92); }
.compass svg { width: 17px; height: 17px; }
.compass span {
  min-width: 22px; text-align: center;
  font-family: var(--serif); font-size: 14px; color: var(--sodium);
}
body.kb-open .compass { opacity: 0; pointer-events: none; }

@media (min-width: 860px) {
  .compass { right: auto; left: 12px; top: calc(74px + var(--safe-t)); }
}


/* --- 표정 고르기 -------------------------------------------------------- */

.emote-bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-b));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(30,36,48,.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1);
  animation: rise .28s cubic-bezier(.16,1,.3,1) both;
}
.emote-bar button {
  display: grid; justify-items: center; gap: 3px;
  padding: 8px 12px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--mute); transition: background .18s, color .18s;
}
.emote-bar button:hover { background: rgba(240,184,88,.16); color: var(--sodium); }
.em { width: 18px; height: 18px; border-radius: 50%; display: block; position: relative; }
.em-joy { background: #f0b858; }
.em-sad { background: #6fa8d8; }
.em-mad { background: #d4756a; }
.em-huh { background: #8a8f9c; }

/* --- 가구 미리보기 ------------------------------------------------------ */

.good .thumb {
  width: 100%; height: 78px; border-radius: var(--r-s);
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.07);
  display: block;
}

/* --- 배송 대기 ---------------------------------------------------------- */

.delivery {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--r-m);
  background: rgba(240,184,88,.08);
  border: 1px solid rgba(240,184,88,.28);
}
.delivery .who { display: grid; line-height: 1.4; }
.delivery b { font-size: 14px; font-weight: 600; }
.delivery em { font-style: normal; font-size: 11.5px; color: var(--mute); font-family: var(--serif); }
.delivery .left { font-size: 13px; color: var(--sodium); font-variant-numeric: tabular-nums; }

/* --- 캐릭터 고르기 ------------------------------------------------------ */

.bodies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.body-pick {
  padding: 8px 6px 10px; border-radius: var(--r-m);
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.035);
  display: grid; justify-items: center; gap: 4px;
  transition: border-color .18s, background .18s;
}
.body-pick:hover { border-color: rgba(240,184,88,.4); }
.body-pick.on { border-color: var(--sodium); background: rgba(240,184,88,.1); }
.body-pick canvas { width: 56px; height: 64px; display: block; }
.body-pick span { font-size: 11.5px; color: var(--paper-dim); }

/* 집 안에서는 방향 돌리기를 숨긴다 */
body.indoors .compass { display: none; }


/* --- 버스 노선 ---------------------------------------------------------- */

.trip {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 14px;
  align-items: center; padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.trip:last-child { border-bottom: 0; }
.trip .bar { width: 4px; align-self: stretch; border-radius: 3px; min-height: 42px; }
.trip h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 600; }
.trip p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--mute); font-family: var(--serif); }
.trip .rate { color: var(--sodium); font-size: 11.5px; margin-top: 4px; font-family: var(--serif); }

/* --- 집 넓히기 ---------------------------------------------------------- */

.upgrade {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; margin-bottom: 12px; border-radius: var(--r-m);
  background: rgba(240,184,88,.08);
  border: 1px solid rgba(240,184,88,.3);
}
.upgrade b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.upgrade em {
  display: block; font-style: normal; font-size: 12.5px; line-height: 1.6;
  color: var(--paper-dim); font-family: var(--serif); margin-bottom: 5px;
}
.upgrade .mini2 { font-size: 12px; color: var(--sodium); font-variant-numeric: tabular-nums; }
.upgrade button {
  flex: none; padding: 11px 16px; border-radius: var(--r-s);
  background: var(--sodium); color: #26211a; font-weight: 700; font-size: 14px;
  transition: filter .18s;
}
.upgrade button:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
