/*
 * shop.css — 장소: 가게 (손님 줄 · 손님 그림과 대사 창 · 부탁 카드 · 행상인 · 단골 수첩)
 */

.shop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 14px; height: 100%; min-height: 0; }
.shop-main, .shop-side { display: flex; flex-direction: column; min-height: 0; }
.shop-side { overflow-y: auto; }

/* 손님 그림 (그림이 없으면 대표색 + 첫 글자) */
.portrait { position: relative; display: flex; align-items: center; justify-content: center; flex: none; background: #fffaf0; box-shadow: 0 0 0 3px var(--wood-dark); }
.portrait { overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; image-rendering: pixelated; }
.portrait.is-empty { background: color-mix(in srgb, var(--who) 22%, #fffaf0); }
.portrait-letter { font-family: var(--font-title); color: var(--who); line-height: 1; }
/* 작은 칸(손님 줄)은 상반신 그림의 얼굴 쪽만 잘라 보여요 */
.portrait-sm { width: 40px; height: 40px; box-shadow: 0 0 0 2px var(--wood-dark); }
.portrait-sm img { object-fit: cover; object-position: 50% 8%; }
.portrait-sm .portrait-letter { font-size: 22px; }
.portrait-md { width: 60px; height: 80px; }
.portrait-md .portrait-letter { font-size: 34px; }
.portrait-lg { width: 168px; height: 224px; transition: transform 0.2s, filter 0.2s; }
.portrait-lg .portrait-letter { font-size: 92px; }
.portrait-lg.is-listening { filter: brightness(0.8); transform: scale(0.97); }
.portrait-lg.mood-happy { transform: translateY(-4px); }
.portrait-lg.mood-surprised { animation: portrait-jump 0.3s; }
.portrait-lg.mood-sad { filter: saturate(0.6) brightness(0.92); }
@keyframes portrait-jump { 40% { transform: translateY(-10px); } }

/* 오늘 온 손님 줄 */
.shop-queue { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; flex: none; }
.queue-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 92px; padding: 8px 6px 6px; border: 0; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); cursor: pointer; font: inherit; color: inherit; }
.queue-card:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--wood); }
.queue-card.is-active { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--wood-dark); }
.queue-card.is-main .queue-name::before { content: '★ '; color: var(--gold); }
.queue-card.is-gone { opacity: 0.55; cursor: default; }
.queue-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.queue-status { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }

/* 무대: 손님 + 대사 창 */
.shop-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 14px; padding: 16px; overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.5), rgba(227, 208, 168, 0.5)); box-shadow: inset 0 0 0 2px var(--paper-edge); }
.shop-stage.is-night { background: linear-gradient(180deg, rgba(58, 52, 88, 0.22), rgba(58, 39, 24, 0.18)); }
.shop-empty { color: var(--ink-soft); font-size: 15px; text-align: center; }
.shop-person { display: flex; align-items: flex-end; gap: 14px; }
.shop-nameplate { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.shop-nameplate b { font-family: var(--font-title); font-size: 24px; font-weight: 400; }
.shop-nameplate small { color: var(--ink-soft); }
.story-tag { align-self: flex-start; padding: 0 8px; background: #efe4f5; box-shadow: 0 0 0 2px #b59ac7; font-size: 12.5px; color: var(--purple); }
.hearts { color: #c0485a; letter-spacing: 2px; font-size: 15px; }
.hearts-empty { color: #c9a7a0; }

.shop-talk, .shop-request { width: min(560px, 100%); padding: 14px 18px; background: #fffaf0;
  box-shadow: 0 -3px 0 0 var(--wood-dark), 0 3px 0 0 var(--wood-dark), -3px 0 0 0 var(--wood-dark), 3px 0 0 0 var(--wood-dark), 0 6px 0 0 rgba(58, 39, 24, 0.15); }
.shop-talk.is-me { background: #eef3f6; }
.talk-who { font-weight: 700; color: var(--red-dark); margin-bottom: 4px; }
.shop-talk.is-me .talk-who { color: var(--blue); }
.talk-text { margin: 0; min-height: 3.4em; font-size: 16px; line-height: 1.75; }
.talk-buttons { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.talk-page { margin-right: auto; font-size: 12px; color: var(--ink-soft); }
.request-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.request-have { font-size: 13px; color: var(--red); }
.request-grade { padding: 0 6px; background: #fff3cf; box-shadow: 0 0 0 2px #d8b25a; font-size: 12.5px; font-weight: 700; color: #8a5a00; }
.request-have.is-ok { color: var(--green); font-weight: 700; }
.request-talk { margin: 0; color: var(--ink-2); }
.request-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-soft); text-align: right; }
.shop-request .report-sub { margin-top: 4px; }
.rep-chip.is-heart { color: #c0485a; font-weight: 700; padding-left: 8px; }

/* 오른쪽 탭 */
.shop-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex: none; }
.shop-tab { flex: 1; padding: 6px 8px; border: 0; background: var(--paper-2); box-shadow: 0 0 0 2px var(--paper-edge); font: inherit; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.shop-tab.is-active { background: #fffaf0; box-shadow: 0 0 0 3px var(--wood-dark); color: var(--ink); font-weight: 700; }

/* 행상인 */
.merchant-greet { margin: 0 0 10px; padding: 8px 12px; background: var(--paper-2); font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.stock-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stock-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); }
.stock-row.is-sold { opacity: 0.55; }
.stock-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stock-info small { color: var(--ink-soft); font-size: 12px; }
.stock-buy { display: flex; gap: 4px; }

/* 단골 수첩 */
.friend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.friend-card { display: flex; gap: 12px; padding: 10px; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); }
.friend-card.is-main { box-shadow: 0 0 0 2px var(--gold); }
.friend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friend-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.friend-head b { font-family: var(--font-title); font-weight: 400; font-size: 18px; }
.friend-head small, .friend-meta, .friend-next { color: var(--ink-soft); font-size: 12px; }
.friend-next { color: var(--purple); }
.friend-desc { margin: 2px 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.hearts-num { margin-left: 4px; font-size: 11.5px; color: var(--ink-soft); letter-spacing: 0; }

/* "아무거나" 주문 */
.rep-chip.is-want { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #6b3f00; }
.want-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; max-height: 120px; overflow-y: auto; padding: 2px; }
.want-choice { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border: 0; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); font: inherit; font-size: 13px; cursor: pointer; }
.want-choice small { color: var(--ink-soft); }
.want-choice.is-active { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--wood-dark); font-weight: 700; }

/* 들은 부탁 한눈에 (손님 줄 · 상태 막대) */
.want-mini { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; background: #fff3cf; box-shadow: 0 0 0 2px #d8b25a; font-size: 11.5px; white-space: nowrap; }
.want-mini .item-icon { transform: scale(0.8); margin: -4px -2px; }
.want-mini .attr-icon { width: 16px; height: 16px; }
.req-tip { min-width: 220px; }
.req-tip-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req-tip-list li { display: flex; align-items: center; gap: 8px; }
.req-tip-line { font-size: 12.5px; color: #5b4632; }
.hud-requests { border: 0; font: inherit; cursor: pointer; color: #7d5a1e; font-weight: 700; background: #fff3cf; box-shadow: 0 0 0 2px #d8b25a; }
.hud-requests:hover { background: #fffaf0; }
.talk-replay { margin-right: auto; }

/* 대사가 넘어갈 때: 글이 살짝 떠오르며 나타나요 */
.talk-text, .talk-who { animation: talk-in 0.32s ease-out; }
@keyframes talk-in { from { opacity: 0; transform: translateY(6px); filter: blur(1.5px); } to { opacity: 1; transform: none; filter: none; } }
.portrait-lg.is-enter { animation: portrait-in 0.35s ease-out; }
@keyframes portrait-in { from { opacity: 0.4; transform: translateX(-10px); } }

/* 낮은 화면: 큰 초상화를 조금 줄여요 (가로:세로 3:4 유지) */
@media (max-height: 760px) {
  .portrait-lg { width: 132px; height: 176px; }
  .portrait-lg .portrait-letter { font-size: 72px; }
}
