/* 우주냥다방 화면. 낮의 카페는 따뜻하게, 우주(밤 보라 + 별빛 노랑)는 강조색으로만. */

/* 글꼴 (assets/fonts, 모두 OFL 무료·상업 가능. 원본에서 쓰는 글자만 남겨 woff2로 줄임)
   --ui: 주아(Jua) 버튼·숫자·제목 등 화면 글자 / --sys: 노토 산스 설정·계정·안내·남은 시간 / --talk: 하이멜로디 대사
   둥글(Dongle)은 주문 카드의 고양이 이름에만 (화면 전체에 쓰니 글자 높이가 들쭉날쭉해서 v0.0.16에 주아로 바꿈)
   둥글·하이멜로디는 글자가 em 안에서 작게 그려져서 size-adjust로 노토와 비슷한 크기로 키우고, 줄 높이는 ascent/descent로 맞춤.
   주아는 굵기가 하나뿐이라 모든 굵기를 같은 파일로 (브라우저가 가짜 굵게를 만들지 않게) */
@font-face { font-family: "Jua"; src: url(../a/fonts-88f67a75/jua-400.woff2) format("woff2"); font-weight: 100 900; font-display: swap; size-adjust: 106%; ascent-override: 86%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "Dongle"; src: url(../a/fonts-88f67a75/dongle-400.woff2) format("woff2"); font-weight: 400; font-display: swap; size-adjust: 180%; ascent-override: 52%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Dongle"; src: url(../a/fonts-88f67a75/dongle-700.woff2) format("woff2"); font-weight: 600 900; font-display: swap; size-adjust: 180%; ascent-override: 52%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Hi Melody"; src: url(../a/fonts-88f67a75/himelody-400.woff2) format("woff2"); font-weight: 100 900; font-display: swap; size-adjust: 150%; ascent-override: 62%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Nanum BaeEunHye"; src: url(../a/fonts-88f67a75/nanumbaeeunhye-400.woff2) format("woff2"); font-weight: 100 900; font-display: swap; size-adjust: 174%; ascent-override: 74%; descent-override: 20%; line-gap-override: 0%; }   /* 나눔손글씨 배은혜체 (OFL): 보드 아래 말풍선 (가로폭이 좁음) */
@font-face { font-family: "Noto Sans KR"; src: url(../a/fonts-88f67a75/notosanskr-400.woff2) format("woff2"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: "Noto Sans KR"; src: url(../a/fonts-88f67a75/notosanskr-700.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  --sys: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --ui: "Jua", var(--sys);
  --talk: "Hi Melody", var(--sys);
  --night: #2c2350;
  --night2: #4a3d7a;
  --star: #ffe27a;
  --cream: #fff7ea;
  --wood: #f3dfc1;
  --ink: #3a2e2a;
  --soft: #8a7b6b;
  --tile: #fffaf2;
  --tile2: #f7ecda;
  --ok: #5cc56b;
}
/* 글자 크기: 모든 글자는 rem(뿌리 글자 크기의 배수). 뿌리 크기는 화면 폭에 맞춰 부드럽게 바뀜
   (게임 폭 472px 이상 = 16px, 412px 폰 ≈ 15px, 360px ≈ 14px). 폰 브라우저가 글자를 멋대로 키우는 것(글자 크기 설정·자동 확대)은 막음 */
html { font-size: calc(clamp(13px, calc(8px + 100vw / 59), 16px) / var(--tz, 1)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[hidden] { display: none !important; }
* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* 아이폰 사파리: 빠르게 두 번 눌러 확대·길게 눌러 뜨는 메뉴·화면 통째로 끌림(고무줄) 막기 (냥다방과 같음) */
html, body { margin: 0; height: 100%; overflow: hidden; -webkit-touch-callout: none; background: var(--night); color: var(--ink);
  font-family: var(--ui);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#app { max-width: 480px; height: 100%; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--cream); padding-top: env(safe-area-inset-top); }

/* 상단 */
/* 냥다방과 같은 비율: 등급 1.1 · 기운 0.84 · 코인 1.36 · 설정 동그라미 */
#hud { display: flex; align-items: center; gap: 6px; padding: 3px 10px 2px; background: var(--night); }   /* 위아래 여백 줄여 위로 붙임 */
.pill { background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; height: 30px; padding: 0 9px 0 5px;
  display: flex; align-items: center; gap: 5px; font-size: 0.875rem; white-space: nowrap; min-width: 0; }
.pill b { font-weight: 800; }
.pill small { opacity: .7; font-size: 0.625rem; margin-left: auto; }
.pill.icon { flex: 0 0 30px; width: 30px; justify-content: center; padding: 0; font-size: 1.0625rem; }
#lvBox { flex: 1.1 1 0; padding: 0 9px 0 3px; }
#enBox { flex: 1.13 1 0; }   /* 기운 칸 실제 폭 20% 넓게 (비율 .84 → 1.13, 다른 칸이 조금씩 양보) */
#coBox { flex: 1.36 1 0; }
.lvNum { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--star); color: var(--night);
  display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; }
.bar { flex: 1; height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--star); transition: width .3s; }
/* 화면 아이콘 그림 (a/ui-6df8dabf/ui-*.png). 'dot'은 버튼의 새 소식 빨간 점 이름이라 아이콘에 쓰지 않음 */
.hico { flex: 0 0 auto; width: 22px; height: 22px; object-fit: contain; display: block; pointer-events: none; }
.pill.icon .hico { width: 21px; height: 21px; }
.uico { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -.3em; margin-right: 3px; pointer-events: none; }
.mico { display: block; width: 56px; height: 56px; margin: 0 auto 2px; object-fit: contain; pointer-events: none; }
#bottom button { display: flex; align-items: center; justify-content: center; gap: 5px; }
.nico { width: 20px; height: 20px; object-fit: contain; pointer-events: none; }
.bag { display: inline-flex; align-items: center; gap: 3px; }
.bag .uico { width: 16px; height: 16px; margin: 0; }
.mapBar .mt { display: flex; align-items: center; gap: 4px; }
.mapBar .uico { width: 18px; height: 18px; margin: 0; }
.node .pin .uico { width: 50%; height: 50%; margin: 0; opacity: .75; }
.cell .cool { flex-direction: column; gap: 1px; }
.cell .cool .uico { width: 46%; height: auto; margin: 0; }

/* 주문 줄 */
#orders { display: flex; gap: 8px; padding: 6px 8px; overflow-x: auto; background: var(--night);
  touch-action: pan-x; min-height: 92px; scrollbar-width: none; }
#orders::-webkit-scrollbar { display: none; }
/* 주문 줄 높이 113px → 92px (약 80%): 카드 안 여백·물건 칸·글자 줄을 줄임 */
.order { flex: 0 0 auto; min-width: 108px; background: var(--cream); border-radius: 12px; padding: 4px 8px;
  display: flex; flex-direction: column; gap: 3px; position: relative; }
.order .crew { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; line-height: 16px; color: var(--soft); }
.order .badge { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.order .badge::after { content: ''; display: block; width: 6px; height: 6px; margin: 3px auto 0; background: var(--star);
  clip-path: polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%); }
/* 주문한 고양이 얼굴 (준비되면 기쁜 얼굴) */
.order .badge.catFace { width: 22px; height: 22px; margin: -3px 0 -3px -2px; border-width: 2px; }
.order .badge.catFace::after { display: none; }
.order .needs { display: flex; gap: 4px; }
.order .need { width: 34px; height: 34px; border-radius: 9px; background: var(--tile2); position: relative; }
.order .need.have { background: #dff5e2; }
.order .need.have::after { content: '✓'; position: absolute; right: -2px; bottom: -4px; background: var(--ok); color: #fff;
  border-radius: 50%; width: 16px; height: 16px; font-size: 0.6875rem; line-height: 16px; text-align: center; }
.order .rw { font-size: 0.6875rem; line-height: 16px; color: var(--soft); }
.order.ready { box-shadow: 0 0 0 3px var(--ok); }
.order .go { background: var(--ok); color: #fff; border-radius: 7px; padding: 0; height: 18px; line-height: 18px; font-size: 0.75rem; font-weight: 700; }

/* 보드 */
#boardWrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px; min-height: 0; touch-action: none;   /* 보드 틀에서 시작한 손가락도 화면 이동·확대로 가로채지 않게 (보드와 같게) */
 
  background: none; position: relative; overflow: hidden; overflow: clip; isolation: isolate; }
/* 가게 보드 뒤 배경은 보드와 아래 안내 줄이 같이 씀(#v-board에 깔고 둘 다 투명): 지금 장소의 완성 모습(--areaBg, game.js가 넣음)을
   나무색으로 덮어 연하게 (그림은 약 30%만 비침). 위 주문 줄은 자기 바탕색으로 덮음 */
body:not(.ev) #v-board { background: linear-gradient(rgba(243,223,193,.7), rgba(243,223,193,.7)), var(--areaBg, none) center / cover no-repeat, var(--wood); }
#boardWrap::before { display: none; }   /* 보드 뒤 발도장 무늬는 지금은 안 씀 */
/* 보드 뒤 발도장 무늬가 천천히 흘러감 (냥다방과 같음, transform으로만 움직임) */
#boardWrap::before { content: ""; position: absolute; top: -240px; left: -120px; right: 0; bottom: 0; z-index: -1; pointer-events: none; opacity: .14; will-change: transform;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='white'%3E%3Cg transform='translate(30 34) rotate(-20)'%3E%3Cellipse cx='0' cy='6' rx='9' ry='7.5'/%3E%3Ccircle cx='-10' cy='-5' r='3.6'/%3E%3Ccircle cx='-3.5' cy='-10' r='3.8'/%3E%3Ccircle cx='4' cy='-10' r='3.8'/%3E%3Ccircle cx='10.5' cy='-5' r='3.6'/%3E%3C/g%3E%3Cg transform='translate(90 92) rotate(18)'%3E%3Cellipse cx='0' cy='6' rx='9' ry='7.5'/%3E%3Ccircle cx='-10' cy='-5' r='3.6'/%3E%3Ccircle cx='-3.5' cy='-10' r='3.8'/%3E%3Ccircle cx='4' cy='-10' r='3.8'/%3E%3Ccircle cx='10.5' cy='-5' r='3.6'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px;
  animation: pawDrift 70s linear infinite; }
@keyframes pawDrift { to { transform: translate3d(120px, 240px, 0); } }

/* 보드 연출 (냥다방에서 옮김) */
.cell > .art { position: relative; z-index: 1; }
/* 쓸 수 있는 장비: 뒤에서 금빛이 숨 쉬듯 */
.cell.ready::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(255,246,201,.95), rgba(255,197,51,.55) 55%, transparent 72%); animation: genGlow 1.6s ease-in-out infinite alternate; }
@keyframes genGlow { from { transform: scale(.86); opacity: .7; } to { transform: scale(1.06); opacity: 1; } }
/* 고른 칸: 하얀 테두리가 두근두근 */
.cell.sel::after { content: ""; position: absolute; inset: 1px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--night2); pointer-events: none; z-index: 2; animation: selPulse .6s ease-in-out infinite alternate; }
@keyframes selPulse { to { transform: scale(1.06); } }
/* 끌고 가는 물건과 합칠 수 있는 칸: 흔들흔들 */
.cell.tgt > .art { animation: tgt .5s ease-in-out infinite alternate; }
@keyframes tgt { from { transform: scale(1); } to { transform: scale(1.12) rotate(-4deg); } }
/* 높은 단계(끝에서 두 번째): 반짝이, 최고 단계: 후광 + 반짝이 둘 */
.cell .tw { position: absolute; right: 6%; top: 2%; z-index: 2; color: #fff; font-size: 0.8125rem; line-height: 1; pointer-events: none; text-shadow: 0 0 5px #ffb300, 0 0 2px #ffb300; animation: twinkle 1.5s ease-in-out infinite; }
.cell .tw.b { right: auto; left: 8%; top: auto; bottom: 10%; font-size: 0.625rem; animation-delay: -.7s; }
.cell.t3::before { content: ""; position: absolute; inset: -4%; border-radius: 50%; background: radial-gradient(circle, rgba(255,236,150,1), rgba(255,197,51,.6) 48%, transparent 72%); animation: halo 1.3s ease-in-out infinite alternate; }
@keyframes twinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .3; } 50% { transform: scale(1.15) rotate(40deg); opacity: 1; } }
@keyframes halo { from { transform: scale(.95); } to { transform: scale(1.1); } }
/* 얼음 칸: 물건이 얼음에 갇혀 있음. 같은 물건을 올리면 깨짐. 옮기거나 주문에 못 씀 */
.cell .ice { position: absolute; inset: 0; z-index: 3; border-radius: 12px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(196,234,255,.55) 40%, rgba(140,205,250,.6)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), inset 0 -4px 8px rgba(80,150,210,.35); }
.cell .ice::before { content: ""; position: absolute; left: 14%; top: 10%; width: 34%; height: 12%; border-radius: 8px; background: rgba(255,255,255,.85); transform: rotate(-20deg); }
.cell .ice::after { content: ""; position: absolute; right: 16%; bottom: 14%; width: 14%; height: 8%; border-radius: 6px; background: rgba(255,255,255,.7); transform: rotate(-20deg); }
@media (prefers-reduced-motion: reduce) { #boardWrap::before, .cell.ready::before, .cell.sel::after, .cell.tgt > .art, .cell .tw, .cell.t3::before { animation: none; } }
#board { display: grid; gap: 4px; width: 100%; max-width: 440px; touch-action: none; }
#hud, #orders, #info, #bottom { flex: 0 0 auto; }
.cell { aspect-ratio: 1; background: var(--tile); border-radius: 12px; position: relative; display: flex;
  align-items: center; justify-content: center; }
.cell:nth-child(odd) { background: var(--tile2); }
/* 생성 장비 칸: 금색 동그라미 테두리로 일반 물건과 구분 */
/* 쓰는 아이템(간식·시계·코인·보석·보급 상자) 칸: 하늘색 바탕 + 점선 테두리 */
.cell.spc { background: #e3f2ff; outline: 2px dashed #7fb2e3; outline-offset: -5px; }
.cell.gen { background-image: radial-gradient(circle at 50% 50%, transparent 0 60%, #f2b705 61% 65%, rgba(242,183,5,.25) 66% 69%, transparent 70%); }
.cell.sel { box-shadow: inset 0 0 0 3px var(--night2); }
.cell.hint { box-shadow: inset 0 0 0 3px var(--ok); }
.art { width: 92%; height: 92%; object-fit: contain; pointer-events: none; display: block; }
.cell .cool { position: absolute; inset: 0; border-radius: 12px; background: rgba(44,35,80,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; text-align: center; }
.cell .left { position: absolute; left: 3px; top: 2px; font-size: 0.625rem; background: var(--night); color: var(--star);
  border-radius: 6px; padding: 0 4px; font-weight: 700; }
.cell .grade { position: absolute; right: 3px; bottom: 1px; font-size: 0.625rem; color: #f2b705; text-shadow: 0 1px 0 #7a5a00; letter-spacing: -1px; }
.cell .cool, .cell .left, .cell .grade, .cell .crown { z-index: 2; }
.cell.pop .art { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }

#ghost { position: fixed; width: 56px; height: 56px; pointer-events: none; z-index: 50; transform: translate(-50%,-50%); }
#ghost .art { width: 100%; height: 100%; }

/* 연출 (냥다방과 같음): 입자 캔버스와 떠오르는 글자. 누르기를 막지 않음 */
#errBar { position: fixed; left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 99; max-width: 464px; margin: 0 auto;
  background: #c0392b; color: #fff; font-size: 0.6875rem; line-height: 1.4; padding: 6px 10px; border-radius: 10px; word-break: break-all; }
.errLog { font-size: 0.6875rem; color: #c0392b; word-break: break-all; -webkit-user-select: text; user-select: text; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#floats { position: fixed; inset: 0; pointer-events: none; z-index: 61; overflow: hidden; }
.float { position: absolute; left: 0; top: 0; font-size: 1.25rem; font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--night), 0 0 6px rgba(20,14,40,.6); white-space: nowrap; will-change: transform; }
.float.combo { color: var(--star); font-size: 1.625rem; }
.float.emo { text-shadow: none; font-size: 1.375rem; }
.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* 아래 */
/* 보드 아래 안내 줄 = 고양이가 말하는 자리. 왼쪽에 고양이 상반신을 크게(아래는 줄 끝에서 잘림, 귀는 보드 쪽으로 살짝),
   오른쪽에 말풍선. 평소(.big)엔 말풍선이 줄을 다 쓰고, 아이템 단계 그림(#chain)이 나오면 한 줄로 줄어듦 */
#info { position: relative; padding: 6px 10px 6px 104px; height: 74px; font-size: 0.8125rem; background: none; }   /* 높이 고정: 단계 줄이 나와도 보드가 안 밀리게 */
#info .irow { display: flex; align-items: center; gap: 6px; height: 30px; }
/* 고양이: 전신 그림(폭 106px)을 아래로 내려 가슴쯤에서 줄 끝에 잘리게(그림 아래 38%를 숨김), 틀 폭은 그림보다 좁게 해서 옆으로 뻗은 꼬리는 안 보이게 */
#infoCat { position: absolute; left: 0; bottom: 0; width: 112px; height: calc(100% + 60px); overflow: hidden; z-index: 6; pointer-events: none; }   /* 보드보다 위에 그려짐(보드를 살짝 가려도 됨) */
#infoCat img { position: absolute; left: -8px; bottom: 0; width: 112px; transform: translateY(38%); filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }   /* 왼쪽으로 붙여 꼬리는 화면 밖, 얼굴 오른쪽은 안 잘리게 */
#infoCat img.flip { transform: translateY(38%) scaleX(-1); }
#infoCat img:not([src]) { display: none; }
#infoText { flex: 1; min-width: 0; position: relative; background: #fff; border-radius: 12px; padding: 5px 10px; font-family: var(--talk); font-weight: 400; font-size: 0.8125rem; line-height: 1.35; color: var(--ink); word-break: keep-all;
  box-shadow: 0 1px 0 rgba(0,0,0,.06); }
#infoText::before { content: ''; position: absolute; left: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left: 0; border-right-color: #fff; }
#info.big .irow { height: 62px; }
#info.big #infoText { flex: 0 1 auto; padding: 7px 11px; font-size: 0.72rem; line-height: 1.4; border-radius: 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }   /* 말풍선은 글 길이만큼, 최대 3줄 */   /* 말풍선은 글 길이만큼 (예전의 약 70%) */
#info.big #infoText { margin-right: auto; }   /* 주머니 버튼은 오른쪽 끝에 그대로 */

#info:not(.big) #infoText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 10px; }   /* 단계 줄과 함께일 땐 짧은 설명 한 줄 */
#info.big #chain { display: none; }
#info.big #infoBtn, #info.big .bag { align-self: center; }
#infoBtn { background: var(--night2); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 0.8125rem; white-space: nowrap; }
.bag { background: var(--night); color: var(--star); border-radius: 10px; padding: 6px 10px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.bag.lock { background: #b9b2a6; color: #eee; }
/* 아이템 줄 보기: 그림 + 화살표 */
#chain { display: flex; align-items: center; gap: 2px; overflow-x: auto; height: 32px; scrollbar-width: none; touch-action: pan-x; }
#chain::-webkit-scrollbar { display: none; }
#chain .ci { flex: 0 0 27px; height: 27px; border-radius: 7px; background: rgba(255,255,255,.6); position: relative; }
#chain .ci.on { background: #fff; box-shadow: 0 0 0 2px var(--night2); }
#chain .ci.unk .art { filter: brightness(0); opacity: .18; }
#chain .ci .crown { width: 10px; right: -2px; bottom: -2px; }
#chain .ar { flex: 0 0 auto; width: 0; height: 0; border: 3px solid transparent; border-left: 5px solid #b39b7c; margin: 0 1px 0 2px; }
.crown { position: absolute; right: -2px; bottom: -2px; width: 24px; pointer-events: none; }
/* 짝 알려 주기: 두 칸이 서로 살짝 다가갔다 돌아옴 (transform만) */
.cell.magnet > .art { animation: magnet 1.6s ease-in-out infinite; }
@keyframes magnet { 0%, 55%, 100% { transform: none; } 22%, 34% { transform: translate(var(--dx), var(--dy)); } }
@media (prefers-reduced-motion: reduce) { .cell.magnet > .art { animation: none; } .cell.magnet { box-shadow: inset 0 0 0 2px var(--star); } }
#bottom button.dot, .tabs button.dot { position: relative; }
#bottom button.dot::after, .tabs button.dot::after { content: ''; position: absolute; top: 3px; right: 18%; width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; }

/* 이야기 장면 (화면 전체) */
#story { position: fixed; inset: 0; z-index: 35; max-width: 480px; margin: 0 auto; overflow: hidden; background: #111; }
#story .sbg { position: absolute; inset: 0; transition: background .4s; }
#story .sbgName { position: absolute; left: 12px; top: calc(12px + env(safe-area-inset-top)); font-size: 0.6875rem; color: rgba(255,255,255,.6); background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 8px; }
#story .stand { position: absolute; bottom: 150px; width: 46%; transition: opacity .2s, transform .2s, filter .2s; }
#story .stand.L { left: 2%; } #story .stand.R { right: 2%; }
#story .stand.dim { filter: brightness(.6); transform: scale(.95); }
#story .stand svg { width: 100%; display: block; }
#story .stand img.cat { width: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
#story .stand img.cat.flip { transform: scaleX(-1); }
#story .stand .nm { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); font-size: 0.75rem; font-weight: 800; color: #5a4b3c; }
#story .stand .face { position: absolute; right: 6%; top: 6%; font-size: 0.6875rem; background: #fff; border-radius: 10px; padding: 2px 7px; color: var(--night2); font-weight: 700; }
#story .sbox { position: absolute; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); min-height: 124px; background: #fff;
  border-radius: 18px; padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
#story .sname { font-weight: 800; font-size: 0.875rem; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-height: 18px; }
#story .sname .badge { width: 14px; height: 14px; border-radius: 50%; }
#story .sname small { color: var(--soft); font-weight: 600; }
#story .stext { font-size: 1.0625rem; line-height: 1.55; }
#story .snext { position: absolute; right: 14px; bottom: 8px; font-size: 0.6875rem; color: var(--soft); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#story .sbox.narr { background: rgba(10,8,24,.82); color: #fff; text-align: center; }
#story .sbox.narr .sname { display: none; }
#story .sbox.hq { background: #0d2a1c; color: #7dffb0; font-family: monospace; border: 3px solid #3b5f4a; }
#story .sletter { position: absolute; left: 8%; right: 8%; top: 22%; background: #fff6df; border-radius: 6px; padding: 28px 22px; font-family: var(--talk);
  font-size: 1.0625rem; line-height: 1.8; color: #5a4636; box-shadow: 0 8px 30px rgba(0,0,0,.35); transform: rotate(-1deg); }
#story .sctl { position: absolute; right: 10px; top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 6px; }
#story .sctl button { background: rgba(0,0,0,.35); color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; }
#story .sctl button.on { background: var(--star); color: var(--night); }

/* 주머니 · 도감 · 설정 */
/* 4차원 주머니 띠: 보드 아래 줄(#info)을 덮고 펼쳐짐. 끌어 놓는 동안 위에 오면 초록(.hot) */
#info { position: relative; }
#bagPanel { position: absolute; inset: 4px 8px; z-index: 7; display: flex; gap: 6px; padding: 5px; background: var(--cream); border-radius: 14px;
  box-shadow: 0 0 0 2px var(--night2) inset, 0 3px 0 rgba(0,0,0,.15); }
#bagPanel.hot { background: #eaf8ec; box-shadow: 0 0 0 3px var(--ok) inset, 0 3px 0 rgba(0,0,0,.15); }
#bagList { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: stretch; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none; }
#bagList::-webkit-scrollbar { display: none; }
.bslot { flex: 0 0 auto; aspect-ratio: 1; max-height: 64px; border-radius: 11px; background: var(--tile); display: flex; align-items: center; justify-content: center; padding: 3px; box-shadow: 0 0 0 1px #eadfcd inset; }
.bslot .art { width: 100%; height: 100%; }
.bslot.empty { background: #f1ebe0; box-shadow: none; border: 2px dashed #d8ccb8; }
.bslot.buy { background: var(--night2); color: #fff; flex-direction: column; gap: 1px; font-size: 0.625rem; font-weight: 700; box-shadow: none; }
.bslot.buy .uico { width: 46%; height: auto; margin: 0; }
#bagX { flex: 0 0 34px; border-radius: 10px; background: rgba(44,35,80,.1); color: var(--night2); font-size: 1rem; }
#bagBtn.on { box-shadow: 0 0 0 2px var(--star); }
.cards, .packRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.packRow { margin-top: 8px; }
.card { aspect-ratio: 3/4; border-radius: 10px; background: var(--cb); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; padding: 4px; text-align: center; }
.card b { font-size: 0.75rem; } .card i { font-style: normal; font-size: 0.625rem; color: #c08a00; }
.card.no { background: #e8e2d6; } .card.no b { color: #aaa; }
.card .tag { position: absolute; top: -6px; right: -4px; background: #ff5a6e; color: #fff; font-size: 0.625rem; font-weight: 800; border-radius: 8px; padding: 1px 6px; }
/* 그림 카드: 그림을 꽉 채우고 이름·별은 아래 띠에. 못 모은 카드는 뒷면 그림 */
.card.art { background: var(--cb) center / cover no-repeat; justify-content: flex-end; padding: 0; overflow: visible; gap: 0; }
.card.art b { width: 100%; background: rgba(255,250,242,.9); font-size: 0.6875rem; padding: 2px 2px 0; border-radius: 0; }
.card.art i { width: 100%; background: rgba(255,250,242,.9); padding-bottom: 2px; border-radius: 0 0 10px 10px; font-size: 0.5625rem; }
.card.art.no { filter: saturate(.85); } .card.art.no b, .card.art.no i { background: rgba(31,27,74,.55); color: rgba(255,255,255,.75); }
.packRow { display: flex !important; justify-content: center; } .packRow .card { flex: 0 0 30%; }
/* 새 카드 / 카드 크게 보기 */
.reveal { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reveal .nw { background: #ff5a6e; color: #fff; font-weight: 800; border-radius: 999px; padding: 2px 12px; font-size: 0.8125rem; }
.reveal .rvCard { width: 80%; aspect-ratio: 360 / 482; border-radius: 14px; overflow: hidden; background: var(--cb); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); margin: 6px 0 4px; }
.reveal .rvCard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reveal .rvCard b { font-size: 1.25rem; }
.reveal small { color: var(--soft); } .reveal h3 { margin: 0 !important; padding: 0 !important; } .reveal i { font-style: normal; color: #c08a00; }
.reveal p { margin: 2px 0 0 !important; word-break: keep-all; }
.setT { font-weight: 800; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.setT small { color: var(--soft); font-weight: 600; } .setT .ok { color: var(--ok); }
.setT button, .rec button:disabled { font-size: 0.75rem; }
.setT button { background: var(--ok); color: #fff; border-radius: 8px; padding: 3px 8px; margin-left: auto; }
.rec button:disabled { background: #c9c1b6; }
.hint { font-size: 0.75rem; color: var(--soft); text-align: center; }
.inp { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #e0d6c6; font: inherit; font-size: 0.9375rem; margin-top: 8px; -webkit-user-select: text; user-select: text; }
.pwBox { position: relative; }
.pwBox .inp { padding-right: 48px; }
.pwEye { position: absolute; right: 4px; top: calc(50% + 4px); transform: translateY(-50%); width: 40px; height: 36px; border: 0; background: none; padding: 0; color: #3a3330; display: flex; align-items: center; justify-content: center; }
.pwEye svg { display: block; }
.acMsg { min-height: 1.2em; color: #c0392b !important; }
.pic { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; font-size: 0.8125rem; flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.pic.framed { position: relative; overflow: visible; box-shadow: none; }
/* 동그라미 안에 고양이 얼굴: 전신 그림의 머리 부분만 (표정 얼굴 그림이 오면 그걸로) */
.catFace { background-repeat: no-repeat !important; background-size: 125% auto !important; background-position: 50% 2% !important; }
.pic .frame { position: absolute; inset: -32%; width: 164%; height: 164%; pointer-events: none; }
/* 시즌 이벤트 테두리는 고리 안쪽 구멍이 더 커서, 금·은·동과 같은 만큼만 얼굴을 덮게 크기를 따로 */
.pic .frame.f-ev { inset: -17.5%; width: 135%; height: 135%; }
.pic .frame.f-pop { inset: -10.5%; width: 121%; height: 121%; }
.pic .frame.f-park { inset: -14.5%; width: 129%; height: 129%; }
.pics { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pics button { border-radius: 50%; padding: 2px; }
.pics button.on { box-shadow: 0 0 0 3px var(--night2); }
.tabs button { font-size: 0.75rem; }
.sub { display: flex; gap: 6px; }
.sub button { flex: 1; padding: 6px 0; border-radius: 10px; background: #efe5d4; font-size: 0.75rem; font-weight: 700; }
.sub button.on { background: var(--star); color: var(--night); }
.rec.rank { gap: 8px; } .rec.rank .no { width: 22px; text-align: center; color: var(--night2); }
.rec.rank.me { box-shadow: 0 0 0 2px var(--star); }
.rec.fb .t { font-weight: 500; font-size: 0.875rem; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.rec.fb .kind { background: var(--night); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 0.6875rem; }
.rec.fb .st { float: right; color: #a08a5e; }
.fbForm { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 14px; padding: 10px; }
.fbForm textarea { min-height: 70px; border-radius: 10px; border: 1px solid #e0d6c6; padding: 8px; font: inherit; resize: vertical; -webkit-user-select: text; user-select: text; }
.fbForm select { align-self: flex-start; padding: 4px 8px; border-radius: 8px; font: inherit; }
.fbForm button, .wide { background: var(--night2); color: #fff; border-radius: 10px; padding: 8px; font-weight: 700; }
.wide { width: 100%; }
#modal .box { max-height: 86vh; overflow-y: auto; }
#modal .box > .row button:disabled { opacity: .5; }
.opt { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid #f0e8dc; font-size: 0.875rem; }
.opt input { width: 20px; height: 20px; }
/* 아래 줄: 지도 · 보드 · 기록 */
#bottom { display: flex; gap: 8px; align-items: center; padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); background: var(--night); }   /* 아래 줄은 얇게 */
#bottom button { flex: 1; color: rgba(255,255,255,.7); font-weight: 700; font-size: 0.875rem; padding: 4px 0; border-radius: 12px; }
#bottom button.on { color: #fff; background: rgba(255,255,255,.14); }
#bottom button.main { flex: 1.3; background: rgba(255,226,122,.25); color: var(--star); font-size: 1rem; }
#bottom button.main.on { background: var(--star); color: var(--night); }
.big { background: var(--star); color: var(--night); font-weight: 800; border-radius: 16px; padding: 12px 28px; font-size: 1.0625rem; }
.ghost { color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 14px; padding: 10px 20px; font-size: 0.875rem; }
.ghost:disabled { opacity: .45; }

/* 화면 갈아 끼우기: transform과 opacity만 움직임 */
#views { flex: 1; position: relative; min-height: 0; overflow: hidden; overflow: clip; }   /* clip: 옆으로 비켜 둔 화면 때문에 생긴 폭을 브라우저가 스크롤하지 못하게 (폰에서 보드가 통째로 밀리던 것) */
.view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--cream);
  opacity: 0; transform: translateX(24px); visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
.view.on { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .2s ease, transform .2s ease; }
.view.left { transform: translateX(-24px); }
@media (prefers-reduced-motion: reduce) { .view, .view.on { transition: none; transform: none; } }
#v-board { background: var(--wood); }
.vhead { background: var(--night); color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.vhead h2 { margin: 0; font-size: 1.0625rem; flex: 1; }
.vhead small { color: var(--star); }
.vhead .back { color: #fff; font-size: 0.875rem; padding: 4px 6px; }
.list { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
/* PC에서 보이는 스크롤 막대가 오른쪽 15px을 먹어 배경이 줄어 보이던 것: 휴대폰처럼 막대 숨김 (끌어서·휠로 스크롤은 그대로) */
.list, .map, #modal .box { scrollbar-width: none; }
.list::-webkit-scrollbar, .map::-webkit-scrollbar, #modal .box::-webkit-scrollbar { display: none; }

/* 지도 (임시 그림) */
#v-map { background: #e9f1dc; }
.map { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
.mapIn { position: relative; height: 230%; min-height: 900px; }
.zone { position: absolute; left: 0; right: 0; }
.zone span { position: absolute; left: 10px; top: 8px; font-size: 0.6875rem; font-weight: 800; color: rgba(0,0,0,.25); letter-spacing: .1em; }
.zone.z1 { top: 52%; height: 48%; background: radial-gradient(circle at 30% 60%, #d6e8c4 0 25%, transparent 26%), #e9f1dc; }
.zone.z2 { top: 33%; height: 19%; background: #f1ead8; }
.zone.z3 { top: 22%; height: 11%; background: linear-gradient(180deg, #bfe6f5, #f3e3b8); }
.zone.z4 { top: 0; height: 22%; background: linear-gradient(180deg, #2c2350, #8c86b8 70%, #cfd8e6); }
.zone.z4 span { color: rgba(255,255,255,.5); }
/* 지도 그림(9:16)이 있으면 조금 더 길게(9:21) 늘이고 양옆을 살짝 잘라 씀. 작전 10곳이 겹치지 않게. 구역 색은 끄고 이름만 남김 */
.mapIn.painted { height: auto; min-height: 0; aspect-ratio: 9 / 21; background: url(../a/map-6b161cec/map-alley.jpg) center / cover no-repeat; }
.mapIn.painted .zone { background: none; }
.mapIn.painted .zone span { color: rgba(255,255,255,.9); text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.mapIn.painted .node .nm, .mapIn.painted .node .pg { background: rgba(255,250,240,.88); border-radius: 8px; padding: 0 5px; }
#v-map .mapTop { z-index: 2; }
/* 처음 하는 사람 안내 */
#guide { position: fixed; z-index: 34; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 3px var(--star), 0 0 0 9999px rgba(20,14,40,.18);
  animation: gpulse 1.2s ease-in-out infinite; transition: left .2s, top .2s, width .2s, height .2s; }
@keyframes gpulse { 50% { box-shadow: 0 0 0 6px var(--star), 0 0 0 9999px rgba(20,14,40,.18); } }
#guideTip { position: fixed; z-index: 34; pointer-events: none; left: 50%; transform: translateX(-50%); max-width: 300px; width: 86vw;
  background: #fff; border-radius: 14px; padding: 8px 12px; font-size: 0.8125rem; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#guideTip b { color: #c08a00; }
.map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; }
.node { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 96px; }
.node .pin { width: 58px; height: 58px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8125rem; color: var(--night2); position: relative; }
.node .pin img { width: 90%; height: 90%; object-fit: contain; pointer-events: none; }
.node .nm { font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.2; }
.node .pg { font-size: 0.6875rem; color: var(--soft); text-align: center; }
.node.cur .pin { box-shadow: 0 0 0 3px var(--star), 0 3px 0 rgba(0,0,0,.12); }
.node.lock .pin { background: #cfcabf; color: #8f897d; }
.node.lock .nm { color: #8f897d; }
/* 지도 위 고양이: 길 위에 한 마리씩, 발이 길에 닿게. 숨 쉬듯 들썩임 (작은 그림이라 transform 애니메이션) */
.mapIn .mc { position: absolute; z-index: 3; width: 42px; padding: 0; margin: -48px 0 0 -21px; }   /* 그림자·움직임 없이 가만히 */
.mapIn .mc img { width: 100%; display: block; }
.mapIn .mc img.flip { transform: scaleX(-1); }
@keyframes mcIdle { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .mapIn .mc { animation: none; } }
.mcSay { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; width: max-content; max-width: 170px;
  background: #fff; color: var(--ink); border-radius: 12px; padding: 6px 10px; font-family: var(--talk); font-size: 0.8125rem; line-height: 1.35; text-align: left; word-break: keep-all;
  box-shadow: 0 3px 8px rgba(0,0,0,.2); animation: toastIn .25s cubic-bezier(.3,1.5,.5,1); }
.mcSay b { display: block; font-family: var(--ui); font-size: 0.6875rem; color: var(--soft); font-weight: 400; }
.mcSay::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.mcSay.below { bottom: auto; top: calc(100% + 6px); }
.mcSay.below::after { top: auto; bottom: 100%; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
.node.done .pin::after { content: ''; position: absolute; right: -12px; top: -16px; width: 30px; height: 30px; background: url(../a/ui-6df8dabf/paw-flag.png) center / contain no-repeat; }
.mapTop { position: absolute; right: 12px; bottom: 10px; background: rgba(44,35,80,.85); color: #fff; border-radius: 12px; padding: 6px 10px; font-size: 0.75rem; }
.mapTop b { color: var(--star); }

.mapBar { display: flex; gap: 8px; padding: 8px 12px; background: var(--night); flex: 0 0 auto; }
.mapBar button { flex: 1; background: rgba(255,255,255,.12); color: #fff; border-radius: 12px; padding: 8px 10px; font-size: 0.8125rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; position: relative; }
.mapBar button b { color: var(--star); }
.mapBar button small { font-size: 0.6875rem; font-weight: 600; opacity: .75; }
.mapBar button.lock { opacity: .5; }
.mapBar button.dot::after { content: ''; position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; }
#evBtn { background: linear-gradient(135deg, #e8833a, #8f4fc7); }

/* 시즌 이벤트 보드 */
body.ev #v-board { background: #3a2c52; }
/* 시즌 이벤트 보드 배경 그림 (보드와 아래 안내 줄이 같이 씀). 흰빛으로 덮어 연하게(그림 약 50%), 가게 보드(30%)보다는 진하게 */
body.ev #v-board { background-position: center; background-size: cover; --evVeil: linear-gradient(rgba(255,250,242,.5), rgba(255,250,242,.5)); }
body.ev[data-evt=ev] #v-board { background-image: var(--evVeil), url(../a/bg-45a35f04/ev-night-market.jpg); }
body.ev[data-evt=pop] #v-board { background-image: var(--evVeil), url(../a/bg-45a35f04/ev-popup.jpg); }
body.ev[data-evt=park] #v-board { background-image: var(--evVeil), url(../a/bg-45a35f04/ev-park.jpg); }
.evBar { flex: 1; background: var(--cream); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.evTop { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.evTop b { flex: 1; color: #c0612a; font-size: 0.9375rem; }
.evTop span { color: var(--soft); font-size: 0.75rem; }
.evTop button { background: var(--night2); color: #fff; border-radius: 10px; padding: 6px 11px; font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 0 #2c2350; }   /* 눌리는 버튼처럼 아래 그림자 */
.evTop button:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c2350; }
.evTrack { position: relative; height: 10px; background: #eadfcd; border-radius: 5px; margin: 6px 8px 6px 0; }
.evTrack i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ffb347, #e8833a); border-radius: 5px; }
.evStep { position: absolute; top: 50%; transform: translate(-50%,-50%); z-index: 1; background: #fff; border: 2px solid #e0cdb0; border-radius: 9px;
  font-size: 0.625rem; font-weight: 800; padding: 0 4px; color: var(--soft); }
.evStep.got { background: #e8833a; border-color: #e8833a; color: #fff; }
.evNow { font-size: 0.75rem; color: var(--soft); }

/* 출근 도장 · 지령 */
.stamps { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.stamps span { width: 32px; height: 32px; border-radius: 50%; background: #eee5d6; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8125rem; color: #b0a493; }
.stamps span.on { background: var(--night2); color: var(--star); }
.rec.mission { text-align: left; margin-top: 6px; background: #faf5ec; }
.mbar { display: block; height: 6px; background: #eadfcd; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--ok); }
.rec .mark { color: var(--ok); font-weight: 800; font-size: 0.8125rem; }

/* 장소 */
.scene { flex: 0 0 38%; margin: 10px 12px 0; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffe9c7 0 62%, #c99a6b 62% 100%); }
.scene .ph { position: absolute; left: 10px; top: 8px; font-size: 0.6875rem; color: #9a7b5c; }
/* 장소 그림 + 끝낸 과제의 소품 (바닥 기준으로 세움). 그림은 세로 그림의 아래쪽(땅)을 보이게 */
.scene { background-size: cover; background-position: center 72%; flex: 0 0 auto; aspect-ratio: 3 / 2; isolation: isolate; z-index: 0; }   /* 소품 겹침 순서(z-index)가 장면 안에서만: 예전엔 소품이 창(상점 등) 위로 올라왔음 */   /* 틀 비율을 고정해야 소품 자리(%)가 그림과 어긋나지 않음 */
.scene .prop { position: absolute; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.28)); }
.scene .prop.flip { transform: translate(-50%, -100%) scaleX(-1); }
.scene .prop.pop { animation: propIn .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes propIn { from { transform: translate(-50%, -100%) scale(.2); opacity: 0; } 60% { opacity: 1; } }
/* 과제 목록의 소품 그림: 아직 안 한 과제는 그림자처럼 */
.task .tprop { flex: 0 0 40px; width: 40px; height: 40px; object-fit: contain; }
.task .tprop.none { visibility: hidden; }
.task.lock .tprop, .task:not(.done) .tprop { filter: brightness(0); opacity: .18; }
.task:not(.done):not(.lock) .tprop { filter: none; opacity: 1; }

/* 기록 */
.tabs { display: flex; gap: 6px; padding: 10px 12px 0; flex: 0 0 auto; }
.tabs button { flex: 1; padding: 8px 0; border-radius: 12px; background: #efe5d4; font-weight: 700; font-size: 0.8125rem; }
.tabs button.on { background: var(--night2); color: #fff; }
.rec { background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.rec .badge { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }
.rec .t { font-weight: 700; }
.rec .d { font-size: 0.75rem; color: var(--soft); }
.rec .tx { flex: 1; }
.rec.lock { opacity: .45; }
.rec button { background: var(--night2); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 0.75rem; font-weight: 700; }
.empty { text-align: center; color: var(--soft); font-size: 0.8125rem; padding: 30px 0; }

/* 시작 화면 */
#title { position: fixed; inset: 0; z-index: 30; background: var(--night); max-width: 480px; margin: 0 auto;
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; overflow: hidden; }
/* 시작 화면 배경: 냥다방 앞마당의 승무원들 (a/cover-3eaee7bf/title-bg.jpg). 고양이들이 아래쪽이라 그림은 아래 기준으로 맞추고,
   제목과 버튼은 위쪽 밤하늘에. 위·아래 끝은 글자가 잘 보이게 살짝 어둡게 */
#title { background: linear-gradient(180deg, rgba(31,27,74,.55) 0, rgba(31,27,74,0) 34%, rgba(31,27,74,0) 82%, rgba(31,27,74,.75) 100%),
  url(../a/cover-3eaee7bf/title-bg.jpg) center bottom / cover no-repeat, var(--night); }
#title .logo { margin-top: calc(env(safe-area-inset-top) + 6vh) !important; }
/* 제목 그림 (a/ui-6df8dabf/title-logo.webp, 지구·우주선 장식 포함) */
#title .logo .tlogo { position: static; display: block; width: min(84vw, 380px); margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
#title .tbtns .ghost { background: rgba(31,27,74,.5); border-color: rgba(255,255,255,.7); }
#title .cover { position: relative; width: 100%; height: 52vh; flex: 0 0 auto; }
#title .cover img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; display: block; }
#title .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, var(--night) 100%); }
#title .logo { text-align: center; margin-top: -40px; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
#title .logo small { color: var(--star); font-weight: 700; letter-spacing: .1em; }
#title .logo b { display: block; font-size: 2.25rem; line-height: 1.15; margin-top: 6px; }
/* 로고 장식: 오른쪽 위에 발도장 깃발 꽂힌 지구, 왼쪽 아래에 둥실 뜬 우주선 */
#title .logo b { display: table; margin-left: auto; margin-right: auto; position: relative; }
#title .logo img { position: absolute; pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
#title .lgE { width: 54px; right: -60px; top: -14px; transform: rotate(10deg); }
#title .lgU { width: 62px; left: -70px; bottom: -6px; animation: ufoBob 2.6s ease-in-out infinite alternate; }
@keyframes ufoBob { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { #title .lgU { animation: none; } }
#title .tbtns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; width: 220px; }
#title .tfoot { margin-top: auto; padding: 0 28px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
#title .tdemo { margin: 0; font-size: 0.6875rem; line-height: 1.45; opacity: .6; word-break: keep-all; max-width: 300px; }
#title .tver { opacity: .5; font-size: 0.6875rem; }
.task { background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.task .t { font-weight: 700; }
.task .d { font-size: 0.75rem; color: var(--soft); }
.task .tx { flex: 1; }
.task.done { opacity: .55; }
.task.lock { opacity: .4; }
.task button { background: var(--night2); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 0.8125rem; font-weight: 700; }
.task button:disabled { background: #c9c1b6; }
.task .mark { color: var(--ok); font-weight: 800; }

/* 덮개: 대화, 모달 */
#dialog { position: fixed; inset: 0; z-index: 40; background: rgba(20,14,40,.45); display: flex; align-items: flex-end; justify-content: center; }
#dialog .dlg { width: min(460px, 94vw); margin-bottom: calc(24px + env(safe-area-inset-bottom)); background: #fff; border-radius: 18px;
  padding: 14px 16px 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#dialog .who { font-weight: 800; font-size: 0.875rem; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
#dialog .who .badge { width: 14px; height: 14px; border-radius: 50%; }
#dialog .txt { font-size: 1rem; line-height: 1.5; min-height: 48px; }
#dialog .next { text-align: right; font-size: 0.6875rem; color: var(--soft); margin-top: 6px; }
#dialog.narr .dlg { background: var(--night); color: #fff; }
#dialog.letter .dlg { background: #fff3d6; }

#modal { position: fixed; inset: 0; z-index: 45; background: rgba(20,14,40,.45); display: flex; align-items: center; justify-content: center; }
#modal .box { position: relative; width: min(360px, 90vw); background: #fff; border-radius: 18px; padding: 16px; text-align: center; }
#modal .mX { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; background: none; font-size: 1.125rem; color: #8a7f78; padding: 0; z-index: 1; }
#modal .box.nudge { animation: nudge .35s; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#modal h3 { margin: 0 0 8px; padding: 0 28px; }
#modal p { margin: 6px 0; font-size: 0.875rem; color: var(--soft); }
#modal .row { display: flex; gap: 8px; margin-top: 12px; }
#modal .row button { flex: 1; padding: 10px; border-radius: 12px; background: #eee; font-weight: 700; }
#modal .row button.main { background: var(--night2); color: #fff; }

/* 알림: 연하고 흐린 흰 유리 (뒤 화면이 흐리게 비침) */
#toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 60; background: rgba(255,255,255,.3); color: var(--night);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset, 0 4px 14px rgba(0,0,0,.12);
  text-shadow: 0 0 6px rgba(255,255,255,.9); font-weight: 700;
  padding: 10px 16px; border-radius: 14px; font-size: 0.875rem; pointer-events: none; max-width: 86vw; text-align: center; }

/* 냥다방에서 옮긴 움직임: 창이 통 튀어나옴, 알림이 올라옴, 전달 가능한 주문이 까딱임, 새 주문이 내려옴, 등급 업 큰 글자 */
#toast:not([hidden]) { animation: toastIn .3s cubic-bezier(.3,1.5,.5,1); }
@keyframes toastIn { from { transform: translateX(-50%) translateY(20px) scale(.8); opacity: 0; } }
#modal:not([hidden]) .box, #dialog:not([hidden]) .dlg { animation: modalIn .35s cubic-bezier(.3,1.5,.5,1); }
@keyframes modalIn { from { transform: scale(.7) translateY(30px); opacity: 0; } }
#modal .box.nudge { animation: nudge .35s; }
.order.ready { animation: readyBob .7s ease-in-out infinite alternate; }
@keyframes readyBob { to { transform: translateY(-4px); } }
.order.enter { animation: orderIn .45s cubic-bezier(.3,1.5,.5,1); }
@keyframes orderIn { from { transform: translateY(-60px) scale(.7); opacity: 0; } }
.lvlup { position: fixed; left: 0; right: 0; top: 34%; z-index: 61; pointer-events: none; text-align: center; font-size: 2.5rem; font-weight: 900; color: #fff;
  -webkit-text-stroke: 2px var(--night); paint-order: stroke fill; text-shadow: 0 4px 0 #ff6b7c; animation: lvl 2s cubic-bezier(.3,1.5,.5,1) forwards; }
@keyframes lvl { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 15% { transform: scale(1.15) rotate(3deg); opacity: 1; } 25% { transform: scale(1); } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .order.ready, .order.enter, #toast:not([hidden]), #modal:not([hidden]) .box, #dialog:not([hidden]) .dlg { animation: none; } }

/* 글꼴 쓰임 (맨 위 @font-face 참고). 기본은 둥글(--ui) */
#story .stext, #story .sletter, #dialog .txt { font-family: var(--talk); }   /* 대사·편지: 하이멜로디 */
#modal p, .opt, .inp, .fbForm textarea, .fbForm select, .errLog, #errBar, #title .tdemo { font-family: var(--sys); }   /* 설정·계정·안내 글: 노토 */
.mapBar button b, .mapBar button small, .evTop span, #enT, .cell .cool { font-family: var(--sys); }
.order .crew { font-family: "Dongle", var(--sys); }   /* 주문 카드의 고양이 이름만 둥글 */   /* 남은 시간·진행 숫자 같은 작은 안내: 노토 */
/* ── v0.0.24: 냥다방에서 옮긴 것들 ── */
/* 과열 장비를 골랐을 때 아래 줄의 식히기 버튼 */
#chain .coolBtn { flex: 0 0 auto; height: 26px; padding: 0 12px; border-radius: 9px; background: var(--night2); color: #fff; font-size: 0.8125rem; font-weight: 700; }
#chain .coolBtn:disabled { background: #b9b2a6; }
/* 등급 창 */
.lvbar { height: 8px; margin: 4px 0 6px; }
.lvlist { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; text-align: left; margin-top: 6px; scrollbar-width: none; }
.lvrow { display: flex; gap: 10px; align-items: flex-start; background: #f7f1e6; border-radius: 10px; padding: 6px 10px; font-size: 0.8125rem; }
.lvrow b { flex: 0 0 34px; color: var(--night2); }
.lvrow.done { opacity: .5; } .lvrow.next { box-shadow: 0 0 0 2px var(--star) inset; background: #fff8dc; }
/* 설정 창의 조작 안내·업데이트 내용 */
.mrow { display: flex; gap: 8px; margin: 8px 0 2px; } .mrow button { flex: 1; padding: 8px; border-radius: 10px; background: #f1eadf; font-weight: 700; font-size: 0.8125rem; }
.help { text-align: left; margin: 6px 0; max-height: 56vh; overflow-y: auto; font-family: var(--sys); font-size: 0.8125rem; }
.help dt { font-family: var(--ui); color: var(--night2); margin-top: 8px; } .help dd { margin: 2px 0 0; color: var(--ink); word-break: keep-all; }
.note { text-align: left; font-family: var(--sys); font-size: 0.8125rem; margin-top: 6px; } .note b { font-family: var(--ui); color: var(--night2); }
.note ul { margin: 2px 0 0; padding-left: 18px; word-break: keep-all; }
/* 아이템 도감 줄 */
.dexRow { display: flex; flex-wrap: wrap; gap: 4px; }
.dexRow .ci { flex: 0 0 36px; height: 36px; border-radius: 9px; background: #fff; position: relative; display: flex; align-items: center; justify-content: center; }
.dexRow .ci.unk .art { filter: brightness(0); opacity: .18; }
.dexRow .ci .crown { width: 12px; right: -3px; bottom: -3px; }
/* 맨 위 등급·기운은 누를 수 있음 */
#lvBox, #enBox { cursor: pointer; }

/* ── v0.0.25 ── */
/* 그림 있는 카드도 눌리게: 보드 그림용 .art(누르기 무시)와 이름이 겹쳐 도감 카드가 안 눌렸음 */
.card.art { pointer-events: auto; width: auto; height: auto; }
/* 주머니 버튼: 두 줄 (주머니 / 그림 0/3), 가로 폭 줄임 */
#bagBtn { flex-direction: column; justify-content: center; gap: 1px; padding: 3px 8px; line-height: 1.1; font-size: 0.6875rem; }
#bagBtn .bn { display: inline-flex; align-items: center; gap: 2px; }
#bagBtn .uico { width: 14px; height: 14px; margin: 0; vertical-align: 0; }
/* 안내 줄 고양이: 80% 크기, 왼쪽 15px는 화면 밖으로, 줄 왼쪽에 붙임. 줄어든 만큼 말풍선을 넓힘 */
#info { padding-left: 80px; }
#infoCat { width: 75px; }
#infoCat img { left: -15px; width: 90px; }
/* 주문 카드: 가로 2배(세로는 그대로), 왼쪽에 고양이 얼굴을 크게 */
.order.ocard { flex-direction: row; align-items: stretch; min-width: 216px; padding: 0; gap: 0; }
.order.ocard .go { margin-top: 1px; }
.order .ocat { flex: 0 0 92px; align-self: stretch; border-radius: 12px 0 0 12px; overflow: hidden; position: relative; }
.order .ocat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.order .obody { flex: 1; min-width: 0; padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.order.ocard .obody { justify-content: center; }
.order.ocard .crew { font-size: 0.9375rem; line-height: 18px; color: var(--ink); }
/* 보드: 칸마다 상자 대신 격자 줄, 보드 바탕만 흐린 흰색 */
#board { gap: 0; background: rgba(255,255,255,.38); border: 1px solid rgba(110,80,50,.22); border-radius: 10px; overflow: hidden; }
.cell, .cell:nth-child(odd) { background-color: transparent; border-radius: 0; box-shadow: inset -1px -1px 0 rgba(110,80,50,.2); }
.cell.spc { background-color: rgba(227,242,255,.7); }
.cell.sel { box-shadow: inset 0 0 0 3px var(--night2); }
.cell.hint { box-shadow: inset 0 0 0 3px var(--ok); }
.cell.sel::after, .cell .cool { border-radius: 4px; }
.cell .ice { border-radius: 2px; }

/* ── v0.0.26 ── 주문 카드: 폭 216 → 173px(80%), 고양이는 전신 그림을 작게(얼굴 높이 약 70%) 카드 아래 끝에서 잘림. 구역 색 나누지 않음 */
.order.ocard { min-width: 173px; }
.order .ocat { flex: 0 0 70px; background: none; border-radius: 12px 0 0 12px; }
.order .ocat img { inset: auto; left: -3px; top: 4px; width: 76px; height: auto; object-fit: initial; }
.order.ocard .obody { padding: 4px 8px 4px 4px; }

/* ── v0.0.27 ── 보드에 세로 공간을 더 주려고(약 3%) 안내 줄 74 → 59px */
/* 주머니 버튼 세 줄: 별가방 그림 / 주머니 / 0/3 */
#bagBtn { padding: 3px 7px; gap: 0; line-height: 1.05; font-size: 0.625rem; }
#bagBtn .uico { width: 15px; height: 15px; margin: 0 0 1px; }
#info { height: 59px; padding: 3px 10px 3px 66px; }
#info .irow { height: 27px; }
#info.big .irow { height: 53px; }
#info.big #infoText { padding: 4px 10px; line-height: 1.28; }
#chain { height: 26px; }
#chain .ci { flex-basis: 24px; height: 24px; }
#chain .coolBtn { height: 23px; }
/* 안내 줄 고양이: 작게, 네모 테두리 칸 안에 (보드 위로 넘치지 않음). 얼굴~가슴이 보이게 */
#infoCat { left: 8px; top: 50%; bottom: auto; width: 48px; height: 48px; margin-top: -24px; border-radius: 11px; background: var(--cream); border: 2px solid #d9c4a3; box-sizing: border-box; }
#infoCat img { left: -4px; top: 3px; bottom: auto; width: 54px; transform: none; filter: none; }
#infoCat img.flip { transform: scaleX(-1); }
/* 주머니 버튼은 안내 줄 오른쪽 끝에 위아래로 길게 고정 (단계 줄이 나와도 겹치지 않게, 말풍선·단계 줄은 그 앞까지) */
#bagBtn { position: absolute; right: 8px; top: 4px; bottom: 4px; width: 40px; padding: 2px 0; z-index: 2; }
#info { padding-right: 54px; }

/* ── v0.0.28 ── */
/* 안내 줄 고양이: 대사용 정면 초상(정사각, 가슴이 아래 끝)을 네모 칸에 그대로 */
/* 네모 칸 없이 배경 투명하게, 줄 왼쪽 아래에 붙여 보드 쪽으로 살짝 올라오게 (가슴이 줄 아래 끝) */
#infoCat { left: 2px; top: auto; bottom: 0; width: 68px; height: 68px; margin-top: 0; border: 0; border-radius: 0; background: none; overflow: hidden; }   /* 그림 아래 5px(지저분한 끝)는 줄 아래 끝에서 잘림 */
#infoCat img, #infoCat img.flip { left: 0; top: auto; bottom: -5px; width: 100%; height: auto; transform: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
#info { padding-left: 74px; }
/* 주문 카드: 전달 버튼 없앰(준비된 카드는 눌러서 전달), 보상 코인은 이름 옆. 남는 자리만큼 글자·물건 칸 키움 */
.order.ocard .crew { display: flex; align-items: center; gap: 6px; font-size: 1.0625rem; line-height: 22px; white-space: nowrap; }
.order.ocard .crew .rw { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-family: var(--sys); font-size: 0.8125rem; line-height: 1; font-weight: 700; color: #8a6a2a; }
.order.ocard .crew .rw .uico { width: 15px; height: 15px; margin: 0; vertical-align: 0; }
.order.ocard .obody { gap: 3px; padding: 4px 9px 4px 4px; }   /* 주문 줄 높이 92px 유지 (보드 공간이 줄지 않게) */
.order.ocard .needs { gap: 5px; }
.order.ocard .need { width: 46px; height: 46px; border-radius: 11px; }
.order.ocard .need.have::after { right: -3px; bottom: -3px; }
.order.ocard.ready .crew .rw { color: var(--ok); }

/* ── v0.0.30 ── 주문 카드 세 줄: 이름·코인 / 물건(원래 크기 34px) / 고양이 한마디 */
.order.ocard .crew { font-size: 1rem; line-height: 18px; }
.order.ocard .obody { gap: 2px; padding: 4px 9px 4px 4px; }
.order.ocard .needs { gap: 4px; }
.order.ocard .need { width: 34px; height: 34px; border-radius: 9px; }
.order.ocard .need.have::after { right: -2px; bottom: -4px; }
.order .osay { font-family: var(--talk); font-size: 0.78rem; line-height: 15px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order.ocard.ready .osay { color: var(--ok); }

/* 알림: 냥다방처럼 하단바 바로 위(game.js가 bottom을 맞춤)에 진한 알약, 작은 보통 글씨. 반투명·흐림 없음 */
#toast { top: auto; bottom: 70px; background: var(--night); color: #fff; -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.18); text-shadow: none; font-weight: 400; font-size: 0.8125rem; padding: 9px 16px; border-radius: 20px; width: max-content; max-width: calc(100% - 48px); word-break: keep-all; z-index: 62; }   /* 가운데 맞춤이라 폭이 반으로 줄던 것: 글 길이만큼 */

/* ── v0.0.31 ── */
/* 대화창: 말하는 고양이 얼굴을 창 왼쪽 위로 살짝 걸치게 */
#dialog .dlg { position: relative; }
#dialog .dcat { position: absolute; left: 10px; bottom: calc(100% - 14px); width: 88px; height: auto; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
#dialog .dlg.hasCat .who { padding-left: 96px; min-height: 20px; }
/* 지도: 열 수 있는 작전이 있으면 지금 작전 핀에 빨간 점 */
.node .pin { position: relative; }
.node .ndot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #ff5a6e; box-shadow: 0 0 0 2px #fff; z-index: 2; }
/* 주머니 띠: 안내 줄보다 조금 위로 키워서(예전 높이만큼), 열려 있는 동안 고양이·주머니 버튼은 숨김 (뒤에서 비쳐 잘린 것처럼 보이던 것) */
#bagPanel { top: -10px; bottom: 2px; left: 8px; right: 8px; }
#info.bagOn #infoCat, #info.bagOn #bagBtn { visibility: hidden; }
.bslot.next { background: rgba(44,35,80,.08); color: var(--soft); flex-direction: column; gap: 1px; font-size: 0.625rem; font-weight: 700; box-shadow: none; border: 2px dashed #d8ccb8; }
.bslot.next .uico { width: 40%; height: auto; margin: 0; opacity: .6; }

/* ── v0.0.34 ── */
/* 프로필 그림: 동그라미로 자르고 초점(object-position, game.js가 그림마다 넣음)을 씀. 아직 못 얻은 건 실루엣 */
.pic { overflow: hidden; background: #fff7ea; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.15); }
.pic.framed { overflow: visible; }
.pic .pimg { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; pointer-events: none; }
.pic.pf-item .pimg { object-fit: contain; padding: 12%; box-sizing: border-box; }
.pic.lock .pimg { filter: brightness(0); opacity: .22; }
.pic.lock { background: #e8e2d6; }
.profGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 2px 12px; }
.prof { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; background: #fff; }
.prof.on { box-shadow: 0 0 0 3px var(--night2); }
.prof b { font-size: 0.6875rem; line-height: 1.2; text-align: center; }
.prof small { font-size: 0.5625rem; line-height: 1.25; color: var(--soft); text-align: center; font-family: var(--sys); }
.rec .pic { margin-right: 4px; }
.mrow { flex-wrap: wrap; }
/* 방금 온 장비: 몇 초 동안 금색 테두리가 두근두근 (game.js freshGen) */
.cell.fresh { box-shadow: inset 0 0 0 3px #ffc533; animation: freshGen .7s ease-in-out infinite alternate; z-index: 1; }
@keyframes freshGen { from { box-shadow: inset 0 0 0 2px #ffc533; } to { box-shadow: inset 0 0 0 5px #ffe27a, 0 0 14px rgba(255,197,51,.8); } }
/* 카드 등급 표시 (큰 카드 보기) */
.tier { font-style: normal; font-size: 0.6875rem; font-weight: 700; padding: 1px 7px; border-radius: 8px; vertical-align: .15em; margin-left: 4px; }
.tier.t-common { background: #ece6da; color: #8a7d68; } .tier.t-rare { background: #dbeaff; color: #2f6fbf; } .tier.t-sp { background: linear-gradient(90deg, #ffe27a, #ffb3d1); color: #8a3a00; }

/* 다른 창에서 게임이 열렸을 때 이 창을 덮는 안내 */
#otherTab { position: fixed; inset: 0; z-index: 200; background: rgba(20,14,40,.7); display: flex; align-items: center; justify-content: center; }
#otherTab .box { background: #fff; border-radius: 18px; padding: 20px; max-width: 300px; text-align: center; }
#otherTab button { margin-top: 10px; padding: 10px 18px; border-radius: 12px; background: var(--night2); color: #fff; font-weight: 700; }
/* 보드 아래 고양이 대사·아이템 설명 말풍선: 가로폭이 좁은 나눔손글씨 배은혜체 (v0.0.43) */
#infoText { font-family: "Nanum BaeEunHye", var(--talk); }

/* ── 장소 무대(3:2 정면) + 꾸미기 모드 (v0.0.44) ── 무대 그림이 있는 작전만 (.scene.stage). 그 밖의 장소는 예전 그대로 */
.scene.stage { background-size: cover; }
.scene.stage .prop { filter: none; }   /* 그림자 없음: 수채 소품이 바닥에서 떠 보여서 */
.scene.stage .prop.night-tint { filter: brightness(.90) saturate(.94) hue-rotate(-4deg); }
.scene.stage .prop.flip { transform: translate(-50%, -100%) scaleX(-1); }
.scene.editing { touch-action: none; user-select: none; -webkit-user-select: none; outline: 2px dashed rgba(255, 226, 122, .85); outline-offset: -3px; }
.scene.editing .prop.movable { pointer-events: auto; cursor: grab; touch-action: none; }
.scene.editing .prop.movable:active { cursor: grabbing; }
.scene.editing .prop.sel { outline: 2px dashed #ffe27a; outline-offset: 2px; border-radius: 8px; }
.scene .sc-btns { position: absolute; right: 8px; top: 8px; z-index: 200; display: flex; gap: 6px; }
.scene .sc-btns button { background: rgba(34, 28, 66, .78); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 5px 9px; border-radius: 999px; }
.scene .sc-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 200; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: rgba(28, 22, 54, .86); color: #fff; font-size: 0.75rem; }
.scene .sc-bar .nm { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .sc-bar button { background: rgba(255, 255, 255, .16); color: #fff; padding: 4px 8px; border-radius: 8px; font-weight: 700; font-size: 0.72rem; }
.scene .sc-bar button.ok { background: var(--star); color: var(--night2); }
.list.dim { opacity: .45; }
/* 꾸미기 중엔 아래 바가 앞줄 바닥 소품을 가려서 위로, 오른쪽 위 버튼은 숨김 (바에 완료가 있음) */
.scene.editing .sc-bar { top: 8px; bottom: auto; }
.scene.editing .sc-btns { display: none; }
/* 무대 작전 완성 표시: 왼쪽 위 구석 리본 (완성 그림으로 바꾸지 않음) */
.scene .sc-done { position: absolute; left: 8px; top: 8px; z-index: 190; display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px 3px 4px; border-radius: 0 999px 999px 0; background: linear-gradient(90deg, #ff6b7c, #ff9a8b); color: #fff; font-size: 0.72rem; font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,.18); pointer-events: none; }
.scene .sc-done img { width: 18px; height: 18px; object-fit: contain; }
.scene.editing .sc-done { display: none; }

/* 설정: 두 개 중 하나 고르기 (아이템 그림 지금/수채화) */
.opt .seg { display: inline-flex; background: #eee6d8; border-radius: 10px; padding: 2px; gap: 2px; }
.opt .seg button { padding: 5px 12px; border-radius: 8px; font-size: 0.8125rem; font-weight: 700; color: var(--soft); }
.opt .seg button.on { background: var(--night2); color: #fff; }

/* v0.0.46 상단 바: 등급은 작은 동그라미(테두리가 경험치), 기운·코인·별사탕은 아이콘이 왼쪽에 걸친 알약, 별사탕 옆 + */
#hud { gap: 7px; padding: 4px 8px 3px; }
#lvBox { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; padding: 0; position: relative; cursor: pointer;
  background: conic-gradient(var(--star) calc(var(--xp, 0) * 1%), rgba(255,255,255,.22) 0); display: flex; align-items: center; justify-content: center; }
#lvBox::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #3d5bd9; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset; }
#lvBox b { position: relative; color: #fff; font-size: 0.875rem; font-weight: 900; text-shadow: 0 1px 0 rgba(0,0,0,.35); font-family: var(--sys); }
#hud .pill { height: 28px; padding: 0 8px 0 0; gap: 3px; background: rgba(255,255,255,.16); }
#hud .pill .hico { width: 26px; height: 26px; margin-left: -5px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
#hud .hemo { flex: 0 0 auto; width: 26px; margin-left: -5px; font-size: 20px; line-height: 1; text-align: center; }
#hud .pill .num { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
#hud .pill .num b { font-family: var(--sys); font-size: 0.875rem; }
#hud .pill small { margin: 1px 0 0; font-size: 0.5625rem; opacity: .8; }
#enBox { flex: 1 1 0; } #coBox { flex: 1.2 1 0; } #gmBox { flex: 1 1 0; cursor: pointer; padding-right: 2px; }
#gmBox .plus { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: #5cc56b; color: #fff; font-weight: 900; font-size: 15px; line-height: 20px; text-align: center; box-shadow: 0 1px 0 rgba(0,0,0,.25); }

/* 잠긴 보드 줄 (별사탕으로 엶) */
.cell.lock { background: rgba(60, 50, 90, .28); box-shadow: none; }
.cell.lock .lk { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; font-size: 0.6875rem; font-weight: 800; font-family: var(--sys); text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.cell.lock .lk img { width: 46%; height: auto; opacity: .9; }
.cell.lock.lk1 { background: rgba(60, 50, 90, .42); }
.rowBuy { text-align: center; } .rowBuy .rbCost { font-size: 1.5rem; font-weight: 900; margin: 6px 0; } .rowBuy .hint { margin-top: 6px; }
.ageChk { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 0.8125rem; margin: 6px 0 0; }
.ageChk small { color: var(--soft); font-size: 0.6875rem; }
