/* 강자비스 마을 보기 (rpg.css의 캐릭터·카드·도장 부품을 함께 씀) */
.main[data-view="village"] { grid-template-columns: minmax(560px, 1fr) minmax(330px, 400px); }
@media (max-width: 860px) { .main[data-view="village"] { grid-template-columns: 1fr; } }

.village { --ink: #1f1a2e; }
.v-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 10px; }
.v-head h2 { margin: 0; font-size: 20px; }
.v-head .sub { color: var(--text-2); font-size: 13.5px; }
.v-simple { margin-left: auto; }

/* 지도 */
.v-map { position: relative; aspect-ratio: 16 / 10; min-height: 330px; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 5px 0 var(--ink);
  background: linear-gradient(var(--sky1) 0, var(--sky2) 17%, #8fd16a 17%, #7cc35a 100%); }
.v-map.morning { --sky1: #9ad0ff; --sky2: #ffe3b0; }
.v-map.day { --sky1: #74c0fc; --sky2: #bfe3ff; }
.v-map.evening { --sky1: #ff922b; --sky2: #ffc9a0; }
.v-map.night { --sky1: #1b1f4b; --sky2: #3b3f7a; }
.v-map.night::after { content: ''; position: absolute; inset: 17% 0 0; background: rgba(20, 24, 70, .28); pointer-events: none; z-index: 5; }
.v-sun { position: absolute; right: 5%; top: 1.5%; font-size: 26px; }
.v-cloud { position: absolute; top: 3%; font-size: 22px; opacity: .9; animation: v-cloud 40s linear infinite; }
.v-cloud.c1 { left: 10%; } .v-cloud.c2 { left: 55%; animation-duration: 55s; animation-delay: -20s; }
@keyframes v-cloud { from { transform: translateX(-40px); } 50% { transform: translateX(60px); } to { transform: translateX(-40px); } }

/* 길·광장·나무 */
.v-road { position: absolute; background: #e2cf9c; border: 2px dashed rgba(120, 90, 40, .35); }
.v-road.h { left: 0; right: 0; top: 60%; height: 7%; border-left: 0; border-right: 0; }
.v-road.v { top: 17%; bottom: 0; left: 47%; width: 6%; border-top: 0; border-bottom: 0; }
.v-plaza { position: absolute; left: 50%; top: 58%; width: 26%; aspect-ratio: 1.6; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(#f1e2b8, #e2cf9c 70%); border: 3px solid rgba(31, 26, 46, .35); }
.v-plaza.low { top: 73%; }
.v-tree { position: absolute; font-size: 24px; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); pointer-events: none; }

/* 건물 */
.bld { position: absolute; transform: translate(-50%, -50%); width: 104px; padding: 0; border: 0; background: none; z-index: 2; display: flex; flex-direction: column; align-items: center; transition: transform .15s; }
.bld:hover { transform: translate(-50%, -54%) scale(1.04); z-index: 6; }
.bld:focus-visible { outline: 3px solid var(--gold, #ffd43b); outline-offset: 4px; border-radius: 8px; }
.bld.enter { transform: translate(-50%, -50%) scale(.94); }
.bld .roof { width: 104px; height: 34px; background: var(--roof); clip-path: polygon(50% 0, 100% 100%, 0 100%); position: relative; filter: drop-shadow(0 -2px 0 var(--ink)); }
.bld .wall { position: relative; width: 84px; height: 50px; background: #fff6e0; border: 3px solid var(--ink); border-top-width: 2px; border-radius: 0 0 6px 6px; box-shadow: 0 4px 0 var(--ink); }
.bld .ico { position: absolute; left: 6px; top: 6px; font-size: 22px; }
.bld .door { position: absolute; right: 10px; bottom: 0; width: 20px; height: 26px; background: #8a5a33; border: 2px solid var(--ink); border-bottom: 0; border-radius: 9px 9px 0 0; }
.bld .sign { margin-top: 7px; font-size: 12px; font-weight: 800; color: #fff; background: rgba(31, 26, 46, .86); border-radius: 7px; padding: 2px 8px; white-space: nowrap; }
.bld .badge { position: absolute; top: 18px; right: 2px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); font-size: 12.5px; font-weight: 900; display: grid; place-items: center; }
.bld .badge.new { background: #ffd43b; animation: v-pulse 1.6s ease-in-out infinite; }
.bld .badge.bad { background: #ff6b6b; color: #fff; animation: v-pulse 1.2s ease-in-out infinite; }
@keyframes v-pulse { 50% { transform: scale(1.15); } }
.bld.small { width: 86px; } .bld.small .roof { width: 86px; height: 26px; } .bld.small .wall { width: 70px; height: 40px; } .bld.small .ico { font-size: 18px; }
.bld.live .wall::after { content: '진행 중'; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); background: #2f9e44; color: #fff; font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 5px; border: 2px solid var(--ink); }

/* 비서의 말풍선 (비서의 집 위) */
.v-say { position: absolute; left: 78%; top: 11%; transform: translateX(-50%); background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; padding: 3px 9px; font-size: 12.5px; font-weight: 800; white-space: nowrap; z-index: 4; animation: bub 2.2s ease-in-out infinite; box-shadow: 0 3px 0 var(--ink); }
.v-say::after { content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); }

/* 사람 */
.v-chr { padding: 0; border: 0; background: none; cursor: pointer; z-index: 3; }
button.v-chr:hover .tag { background: #4c6ef5; }
.v-chr.online:not(.me) { animation: v-wander 7s ease-in-out infinite; animation-delay: var(--d); }
@keyframes v-wander { 0%, 100% { margin-left: 0; } 30% { margin-left: 10px; } 60% { margin-left: -8px; } }
.v-chr.off { transform: translate(-50%, -50%) scale(.82); }
.v-chr.off:not(.rest) .tag { background: rgba(31, 26, 46, .5); }
.v-chr.rest .spr { filter: grayscale(.4) opacity(.8); }
.v-chr.me .spr::before { content: '▼'; position: absolute; left: 50%; top: -15px; transform: translateX(-50%); color: #4c6ef5; font-size: 11px; animation: bub 1.2s ease-in-out infinite; }

.v-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 2px 14px; font-size: 12.5px; color: var(--text-2); }
.v-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; border: 1.5px solid var(--ink); }
.dot.on { background: #51cf66; } .dot.rest { background: #ffd43b; } .dot.off { background: #ced4da; }

/* 퀘스트 게시판 */
.quest-board { margin: 0 0 14px; padding: 12px 12px 6px; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(#c9935a, #b07a43); }
.quest-board.daily { background: linear-gradient(#8ccf74, #6fb556); }
.quest-board.sent { background: linear-gradient(#9fa8da, #7f8ac4); padding-bottom: 12px; }
.quest-board.sent summary { cursor: pointer; color: #fff; }
.qb-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; color: #fff; text-shadow: 0 2px 0 rgba(31, 26, 46, .6); }
.qb-head b { font-size: 16.5px; }
.qb-sub { font-size: 13px; font-weight: 700; }
.qb-sub em { font-style: normal; background: #ff6b6b; border-radius: 6px; padding: 0 6px; text-shadow: none; }
.qb-stamps { margin-left: auto; font-size: 12.5px; font-weight: 800; background: rgba(255, 255, 255, .9); color: var(--ink); text-shadow: none; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; }

/* 받은 일 카드를 퀘스트 종이처럼 */
.quests .card, .quest-board .card { background: #fffaf0; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); position: relative; }
.quests .card::before { content: ''; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #e03131; border: 2px solid var(--ink); }
.quests .card.k-지시 { border-left: 7px solid #7048e8; } .quests .card.k-요청 { border-left: 7px solid #f76707; } .quests .card.k-공유 { border-left: 7px solid #4c6ef5; } .quests .card.k-보고 { border-left: 7px solid #2f9e44; } .quests .card.k-도움 { border-left: 7px solid #e03131; }
.quest-board .checks { background: #fffaf0; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }

.lib-shelf { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

@media (max-width: 640px) {
  .v-map { aspect-ratio: auto; height: 420px; }
  .bld { width: 80px; } .bld .roof { width: 80px; height: 26px; } .bld .wall { width: 64px; height: 40px; } .bld .ico { font-size: 17px; } .bld .door { width: 15px; height: 20px; }
  .bld .sign { font-size: 11px; padding: 1px 5px; }
  .v-say { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .v-chr, .v-cloud, .v-say, .bld .badge, .chr .spr { animation: none !important; }
}

/* 지금 자리에 없는 사람 줄 */
.v-off { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 4px; margin: 10px 2px 0; padding: 6px 10px 4px; background: #eef0e6; border: 2px dashed rgba(31, 26, 46, .25); border-radius: 10px; }
.v-off-label { font-size: 12px; font-weight: 800; color: var(--text-2); margin-right: 6px; align-self: center; }
.v-chr.static { position: relative; left: auto !important; top: auto !important; transform: scale(.82); margin: -6px -4px; }
