@charset "utf-8";
/* -----------------------------------------------
	* 상점 (shop/skin/shop.skin.php) — 아치 틀 창 하나 = 가게 안 한 장면
--------------------------------------------------
	왼쪽 ~ 가운데: 유리 진열장(카키 나무 틀 · 선반 판자 · 가격표 · 유리 반사)
	오른쪽: 점원(서 있는 자리) + 머리 위 말풍선(대사 · 고른 물건 설명 · 구매)
	뒤: 프로필처럼 반투명 판 한 겹 — 아치 창의 격자가 살짝 비친다(11/21 흐린 마트 사진 img/shop/mart-blur.webp 대신)
	기능(분류 · 검색 · 빈 선반 채우기 · 대사 넘기기 · 구매)은 shop/index.php 스크립트가 그대로 맡는다.
	예전 모양(docs 틀 · 격자 칸)은 git 커밋 eb574a7 이전에 있다.
--------------------------------------------------*/

.rc-shop {
  --sh-plank: color-mix(in srgb, var(--a-frame) 72%, #2a2216);
  --sh-glass: rgba(26, 24, 21, .84);
  --sh-glass-line: rgba(236, 230, 214, .1);
  --sh-ink: var(--a-ink);
  --sh-sub: var(--a-sub);
  --sh-veil: linear-gradient(90deg, rgba(18, 17, 15, .86) 0%, rgba(18, 17, 15, .7) 48%, rgba(18, 17, 15, .28) 78%, rgba(18, 17, 15, .18) 100%);
}
html[data-theme="light"] .rc-shop {
  --sh-plank: color-mix(in srgb, var(--a-frame) 78%, #5a4628);
  --sh-glass: rgba(252, 249, 242, .86);
  --sh-glass-line: rgba(90, 70, 30, .12);
  --sh-veil: linear-gradient(90deg, rgba(248, 245, 238, .9) 0%, rgba(248, 245, 238, .72) 48%, rgba(248, 245, 238, .22) 78%, rgba(248, 245, 238, .12) 100%);
}

.shop-band { display: none; }   /* 폰에서만(아래 860px) */
.rc-shop .rc-arch-win { padding: 0; overflow: visible; }   /* 말풍선이 창 위로 넘어가게. 배경 · 점원은 .shop-scene 이 아치로 자른다 */
/* 말풍선이 위쪽 줄(.rc-arch-top, z-index 40) 위에 그려지도록 창 · 점원 칸이 따로 쌓이지 않게 둔다 */
.rc-shop .rc-arch-win,
.rc-shop .shop-stage { z-index: auto; }

/* 장면: 왼쪽 진열장 / 오른쪽 점원. 높이는 화면에 맞춰 한 장면으로 */
#shop_page {
  position: relative;
  flex: 1 1 0;   /* 창(위쪽 줄 아래 남은 높이)을 꼭 채운다 — 화면보다 길어져 아래 스크롤이 생기지 않게 */
  min-height: 500px;   /* 이보다 낮은 창에서만 스크롤 */
  display: grid;
  grid-template-columns: 58.5% minmax(0, 1fr);   /* 진열장 오른쪽 끝 ≈ 장면 폭 61% */
  gap: 0 2%;
  /* 세로로 긴 화면(가로 ≤ 세로)은 아래 폰 배치로 간다 */
  padding: 112px 0 92px 6%;
  box-sizing: border-box;
  /* 화면 비가 달라도 같은 구도: 말풍선 자리(위 4.9cqw · 왼쪽 65.5cqw · 폭 30cqw)를
     장면 폭 단위(cqw = 안쪽 폭의 1%)로 두고, 점원(머리 ~ 골반, 세로/가로 1.383)은
     머리가 말풍선 꼬리 바로 아래, 상반신이 장면을 채우게 크게(아래는 잘린다).
     cqh · cqw 는 여백 뺀 안쪽 크기라 장면(여백 포함) 높이는 100cqh + 204px(위 112 + 아래 92) */
  container-type: size;
  --bubble-w: max(280px, 30cqw);
  --bubble-x: 65.5cqw;
  --tail-x: calc(var(--bubble-x) + 0.7 * var(--bubble-w));   /* 꼬리(말풍선 오른쪽에서 30%) */
  --npc-top: calc(4.9cqw + 122px);                            /* 말풍선 위 + 한 줄 대사 높이 + 꼬리 */
  --npc-w: max(42cqw, calc((100cqh + 204px - var(--npc-top)) / 1.383));   /* 상반신이 꽉 차게(아래는 장면 밖으로 잘림) · 세로가 긴 화면은 바닥까지 */
}
.shop-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 200px 200px 0 0;   /* 창(.rc-arch-win)과 같은 아치 */
}
/* 점원 층: 아래(장면 바닥)만 자르고 옆 · 위는 창 밖 카키 틀까지 튀어나와도 된다(오른팔이 창 끝에서 잘리지 않게) */
.shop-scene.is-front { z-index: 2; pointer-events: none; overflow-x: visible; overflow-y: clip; border-radius: 0; clip-path: inset(-400px -30px 0 -400px); }   /* overflow-y: clip — 잘린 아랫부분이 페이지 길이(스크롤)에 들어가지 않게 */
.shop-scene.is-front #shop_npc { pointer-events: auto; }
.shop-scene-bg {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #1b1a18 55%, transparent);   /* 멤버 프로필(css/member-profile.css)과 같은 판 */
  pointer-events: none;
}
html[data-theme="light"] .shop-scene-bg { background: color-mix(in srgb, var(--a-paper) 58%, transparent); }
#item_list_box,
.shop-stage { position: relative; z-index: 1; min-height: 0; }

/* ---------------------------------------------- 진열장 */
#item_list_box { display: flex; flex-direction: column; }

/* 분류 탭 + 검색: 진열장 위 */
#shop_top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 14px;
}
#shop_cate ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
#shop_cate .shop_tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--a-line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-win) 78%, transparent);
  color: var(--sh-ink);
  font-size: 13.5px;
  font-weight: 700;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
#shop_cate .shop_tab:hover { border-color: var(--a-gold); }
#shop_cate .shop_tab.point { border-color: var(--a-frame); background: var(--a-frame); color: #1d1c1b; }

#shop_search { position: relative; flex: 0 1 260px; }
#shop_search_input {
  width: 100%;
  min-height: 34px;
  padding: 0 34px 0 16px;
  border: 1px solid color-mix(in srgb, var(--a-line) 80%, transparent) !important;
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-win) 82%, transparent) !important;
  color: var(--sh-ink) !important;
  font-size: 13.5px;
  box-shadow: none !important;
}
#shop_search_input:focus { border-color: var(--a-gold) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-gold) 25%, transparent) !important; }
#shop_search_input::-webkit-search-cancel-button { display: none; }
#shop_search_clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sh-sub);
  font-size: 11px;
  transform: translateY(-50%);
  cursor: pointer;
}
#shop_search_clear:hover { background: color-mix(in srgb, var(--a-line) 50%, transparent); color: var(--sh-ink); }
#shop_search.has_text #shop_search_clear { display: block; }

/* 진열장 틀(나무) + 유리 */
.shop-case {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  padding: 12px;
  border-radius: 16px 16px 8px 8px;
  background: var(--a-grain-frame), var(--a-frame);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -2px 0 rgba(0, 0, 0, .12),
    0 26px 40px -24px rgba(0, 0, 0, .7);
}
/* 유리 반사: 비스듬한 빛 두 줄 */
.shop-case::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(112deg, rgba(255, 255, 255, .075) 0 14%, transparent 14% 58%, rgba(255, 255, 255, .05) 58% 61%, transparent 61%);
  pointer-events: none;
}
#shop_item_list {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 8px 8px 3px 3px;
  background: var(--sh-glass);
  box-shadow: inset 0 0 0 1px var(--sh-glass-line), inset 0 14px 22px -14px rgba(0, 0, 0, .45);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--a-frame) 70%, transparent) transparent;
  transition: opacity .2s ease;
}
#shop_item_list.is_swapping { opacity: .3; }

/* 선반: 칸마다 아래 판자를 깔고 칸 사이를 0 으로 붙여 한 줄 선반이 된다 */
#shop_item_list > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  column-gap: 0;
  row-gap: 26px;
  margin: 0;
  padding: 20px 18px 30px;
  list-style: none;
}
#shop_item_list > ul > li {
  position: relative;
  min-height: 118px;
  border-bottom: 7px solid var(--sh-plank);
  box-shadow: 0 12px 12px -10px rgba(0, 0, 0, .5);
}
#shop_item_list > ul > li.off { display: none; }
#shop_item_list li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  padding: 10px 6px 12px;
  border-radius: 10px 10px 0 0;
  color: var(--sh-ink);
  text-decoration: none;
  transition: background-color .2s ease;
}
#shop_item_list .slot_img { display: flex; align-items: flex-end; justify-content: center; width: 64px; height: 64px; }
#shop_item_list .slot_img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .35));
  transition: transform .25s ease;
}
#shop_item_list .slot_name {
  max-width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 가격표: 선반 판자 앞에 걸린 작은 종이 */
#shop_item_list .slot_tag {
  position: absolute;
  left: 50%;
  bottom: -17px;
  z-index: 1;
  padding: 1px 7px;
  border-radius: 2px;
  background: #f6f1e4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color: #2b2621;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
  transform: translateX(-50%);
}
/* 분류 이름은 검색할 때만(다른 분류 물건이 섞이니까) */
#shop_item_list .slot_cate {
  position: absolute;
  top: 4px;
  left: 6px;
  display: none;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-frame) 35%, transparent);
  color: var(--sh-sub);
  font-size: 10px;
  line-height: 16px;
}
#shop_item_list.searching .slot_cate { display: block; }
#shop_item_list li a:hover { background: color-mix(in srgb, var(--a-gold) 9%, transparent); }
#shop_item_list li a:hover .slot_img img { transform: translateY(-4px); }
#shop_item_list li.selected a { background: color-mix(in srgb, var(--a-gold) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a-gold) 55%, transparent); }
#shop_item_list li.selected .slot_img img { transform: translateY(-4px); }
#shop_item_list li a:focus-visible { outline: 2px solid var(--a-gold); outline-offset: -2px; }
/* 빈 선반 자리 */
#shop_item_list > ul > li.slot_blank { min-height: 118px; }

#shop_empty {
  display: none;
  margin: 0;
  padding: 60px 20px;
  color: var(--sh-sub);
  font-size: 14px;
  text-align: center;
}
#shop_empty.on { display: block; }

/* 내 지갑: 진열장 아래 오른쪽 */
#shop_wallet {
  display: inline-flex;
  align-self: flex-start;
  align-items: baseline;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 16px;
  border: 1px solid color-mix(in srgb, var(--a-line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-win) 82%, transparent);
  color: var(--sh-ink);
}
#shop_wallet .wallet_label { color: var(--sh-sub); font-size: 12px; font-weight: 700; }
#shop_wallet #shop_wallet_value { font-size: 15px; font-weight: 800; transition: transform .2s ease; display: inline-block; }
#shop_wallet #shop_wallet_value.bump { transform: scale(1.18); }
#shop_wallet .wallet_unit { color: var(--sh-sub); font-size: 12.5px; }

/* ---------------------------------------------- 점원 + 말풍선 */
.rc-shop .shop-stage { position: static; }

/* 점원: 머리 ~ 허벅지 반신(그림 파일을 미리 잘라 둠). 잘린 아랫단 = 장면 바닥 */
#shop_npc {
  position: absolute;
  top: var(--npc-top);
  left: calc(var(--tail-x) - 0.57 * var(--npc-w));   /* 그림 안 머리 가운데 ≈ 폭의 57% */
  width: var(--npc-w);
  cursor: pointer;
}
#shop_npc img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .35));
  user-select: none;
  -webkit-user-drag: none;
}

/* 말풍선: 크림 종이 · 점원 머리 쪽으로 꼬리. 이름표는 왼쪽 위 카키 쪽지 */
.shop-bubble {
  position: absolute;   /* 기준 = #shop_page. 꼬리가 점원 머리 위 */
  z-index: 45;
  top: 4.9cqw;
  left: var(--bubble-x);
  width: var(--bubble-w);
  margin: 0;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: var(--a-paper);
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .12);
  color: var(--a-paper-ink);
}
.shop-bubble::after {
  content: "";
  position: absolute;
  right: 30%;
  bottom: -13px;
  width: 26px;
  height: 26px;
  border-radius: 0 0 6px 0;
  background: var(--a-paper);
  transform: skewX(-24deg) rotate(45deg);
}
.shop-bubble-name {
  position: absolute;
  top: -12px;
  left: 18px;
  padding: 3px 12px 2px;
  background: var(--a-frame);
  color: #1d1c1b;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .04em;
  transform: rotate(-2deg);
}
#item_info { position: relative; z-index: 1; max-height: min(44cqh, 340px); overflow-y: auto; scrollbar-width: thin; }
#item_info .type-item.theme-box {
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: inherit;
}

/* 대사 (미연시처럼 한 자씩 · 누르면 다음) */
#default_talk { position: relative; min-height: 52px; padding-right: 18px; cursor: pointer; user-select: none; -webkit-user-select: none; }
#default_talk p { min-height: 52px; margin: 0; color: var(--a-paper-ink); font-size: 15px; line-height: 1.75; }
#default_talk .talk_caret {
  display: inline-block;
  width: 2px;
  height: 15px;
  margin-left: 2px;
  background: var(--a-paper-sub);
  vertical-align: -2px;
  animation: shop_caret .6s steps(1) infinite;
}
@keyframes shop_caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
#default_talk .talk_next {
  position: absolute;
  right: 0;
  bottom: 2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid color-mix(in srgb, var(--a-frame) 80%, #5a4628);
  animation: shop_talk_blink 1.4s ease-in-out infinite;
}
@keyframes shop_talk_blink { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(2px); } }

/* 고른 물건 설명 */
#item_simple_viewer .item_tit { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
#item_simple_viewer .item-thumb {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--a-paper-line) 45%, transparent);
}
#item_simple_viewer .item-thumb img { max-width: 42px; max-height: 42px; object-fit: contain; }
#item_simple_viewer .item-name { color: var(--a-paper-ink); font-size: 16px; font-weight: 800; line-height: 1.4; }
#item_simple_viewer .item-name sup {
  display: inline-block;
  top: 0;
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-frame) 45%, transparent);
  color: var(--a-paper-ink);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}
#item_simple_viewer .item-content { color: var(--a-paper-sub); font-size: 13.5px; line-height: 1.7; }

/* 수량 · 구매 */
#item_info .buy-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--a-paper-sub); font-size: 12.5px; }
#item_info .buy-qty-label { margin-right: 2px; font-weight: 700; }
#item_info .buy-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--a-paper-line);
  border-radius: 50%;
  background: transparent;
  color: var(--a-paper-ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
#item_info .buy-qty-btn:hover:not(:disabled) { border-color: var(--a-paper-ink); }
#item_info .buy-qty-btn:disabled { opacity: .35; cursor: default; }
#item_info .buy-qty-input {
  width: 46px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--a-paper-line) !important;
  border-radius: 8px;
  background: #fff !important;
  color: #232323 !important;
  font-size: 13px;
  text-align: center;
  -moz-appearance: textfield;
}
#item_info .buy-qty-input::-webkit-inner-spin-button,
#item_info .buy-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#item_info .buy-qty-total { flex-basis: 100%; color: var(--a-paper-ink); font-weight: 700; }
#item_info #btn_buy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  border: 0 !important;
  border-radius: 999px;
  background: #232323 !important;
  color: #f2ede0 !important;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none !important;
  transition: background-color .2s ease, color .2s ease;
}
#item_info #btn_buy:hover { background: var(--a-frame) !important; color: #1d1c1b !important; }
#item_info #btn_buy.is_disabled { background: color-mix(in srgb, var(--a-paper-line) 60%, transparent) !important; color: var(--a-paper-sub) !important; cursor: default; pointer-events: none; }
#item_info #btn_buy.is_busy { opacity: .6; pointer-events: none; }

/* ---------------------------------------------- 구매 결과 토스트: 장면 가운데 */
#shop_toast {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 20;
  max-width: 80%;
  padding: 11px 28px;
  border-radius: 999px;
  background: rgba(29, 28, 27, .92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
#shop_toast.on { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
#shop_toast p { margin: 0; color: #f2ede0; }

/* ---------------------------------------------- 좁은 PC */

/* ---------------------------------------------- 폰 · 세로 화면(태블릿 세로 등): 맨 위 SHOP 배너 → 진열장 → 맨 아래 대화창. 점원 · 배경 사진 없음
   (점원 그림 · 창 밖으로 나가는 말풍선은 좁은 화면에서 겹치고 깨진다 — 2026-11-20 사용자 요청으로 뺐다) */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  #shop_page {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    padding: 0 12px 110px;
    container-type: normal;
  }
  .rc-shop .shop-band.rc-notice-band.is-hero { display: block; grid-column: 1 / -1; margin: 0 -12px 22px; }   /* 공지 배너의 -40px(공지 창 여백 상쇄)을 쓰지 않는다 */
  .shop-scene { display: none; }
  .rc-shop .rc-arch-win { z-index: 2; }   /* 위쪽 줄 위로 넘어가지 않게 원래대로 */
  .rc-shop .shop-stage { position: relative; order: 2; display: block; margin-top: 26px; }
  /* 대화창: 폭 가득 · 꼬리 없음 · 큰 글씨 */
  .shop-bubble {
    position: relative;
    z-index: 1;
    top: auto;
    left: auto;
    bottom: auto;
    width: auto;
    margin: 0;
    padding: 22px 18px 16px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--a-paper-line) 80%, transparent);
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .5);
  }
  .shop-bubble::after { display: none; }
  .shop-bubble-name { top: -11px; left: 14px; font-size: 13px; }
  #item_info { max-height: none; }
  #default_talk { min-height: 0; padding-right: 20px; }
  #default_talk p { min-height: 27px; font-size: 15.5px; line-height: 1.75; }
  #item_simple_viewer .item-name { font-size: 16.5px; }
  #item_simple_viewer .item-content { font-size: 14px; }
  #item_info .buy-qty { font-size: 13px; }
  #item_info .buy-qty-btn { width: 32px; height: 32px; }
  #item_info .buy-qty-input { height: 32px; }
  #item_info #btn_buy { min-height: 44px; font-size: 15px; }
  #shop_top { flex-direction: column; align-items: stretch; }
  #shop_search { flex-basis: auto; }
  #shop_item_list { overflow: visible; }
  .shop-case { padding: 9px; }
  .shop-case::after { inset: 9px; }
  #shop_item_list > ul { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); row-gap: 24px; padding: 14px 8px 24px; }
  #shop_item_list > ul > li,
  #shop_item_list > ul > li.slot_blank { min-height: 104px; }
  #shop_item_list li a { padding: 8px 4px 10px; }
  #shop_item_list .slot_img { width: 46px; height: 46px; }
  #shop_item_list .slot_name { font-size: 12px; }
}
