/* ══════════════════════════════════════════════════════════════
   꼬마영웅 천하통일 — 밝은 수채화 + 먹선 + 금빛 테마
   ══════════════════════════════════════════════════════════════ */
:root {
  --ink: #2b2416;
  --ink-2: #443a24;
  --ink-soft: #6b5c3d;
  --paper: #f6ead0;
  --paper-2: #eeddb9;
  --paper-3: #e3cfa6;
  --gold: #b8862f;
  --gold-l: #e3bd63;
  --gold-d: #7d5a1d;
  --green: #47673c;
  --green-d: #2f4728;
  --blue: #3f6fb5;
  --red: #a8443a;
  --shadow: 0 10px 26px rgba(48, 36, 16, 0.28);
  --serif: "Noto Serif CJK KR", "Nanum Myeongjo", "Apple SD Gothic Neo", serif;
  --sans: "Noto Sans CJK KR", "Pretendard", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #26200f; }
/* v5.50 — 삼성 인터넷·안드로이드 크롬의 글자 자동 확대(auto text inflate)가
   고정 폭 머리줄(성 이름·◀▶)을 밀어내 "영.."으로 자르던 문제를 막는다 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
#app { position: fixed; inset: 0; overflow: hidden; height: 100dvh; }
/* dvh 를 모르는 브라우저는 inset:0 그대로 — 아래 height 선언이 무시된다 */
img { -webkit-user-drag: none; user-select: none; }
button { font-family: inherit; cursor: pointer; }
em { font-style: normal; }
b { font-weight: 700; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* 종이 질감 */
.paper-tex {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 22%, rgba(184, 134, 47, 0.08), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(71, 103, 60, 0.07), transparent 46%),
    repeating-linear-gradient(0deg, rgba(120, 94, 48, 0.035) 0 1px, transparent 1px 3px);
}

/* ───────────── 공용 버튼 ───────────── */
.btn { border: 0; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.btn-primary {
  color: #fff6df;
  background: linear-gradient(180deg, #5a7a4a, #3a5530);
  border: 1px solid #24371d;
  box-shadow: inset 0 1px 0 rgba(255, 235, 180, 0.35), 0 4px 12px rgba(30, 40, 20, 0.3);
}
.btn-primary.danger { background: linear-gradient(180deg, #b4553f, #88342a); border-color: #5c2119; }
.btn-paper {
  color: var(--ink); background: linear-gradient(180deg, #f7ecd4, #e6d2a8);
  border: 1px solid #b99a5e; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-ghost { color: var(--paper); background: rgba(43, 36, 22, 0.45); border: 1px solid rgba(227, 189, 99, 0.5); }
.btn:active { transform: translateY(1px); filter: brightness(0.96); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(227, 189, 99, 0.45);
  background: rgba(43, 36, 22, 0.55); color: #f2dfb4; font-size: 17px; line-height: 1;
  display: grid; place-items: center;
}
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(227, 189, 99, 0.65);
  background: rgba(38, 31, 18, 0.9); color: #f3e2b8; font-size: 18px; display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.round-btn.small { width: 34px; height: 34px; font-size: 14px; }

/* ═══════════════ 표지 ═══════════════ */
/* v14 — 표지 일러스트(title_bg.webp): 가로를 꽉 채워 네 영웅이 잘리지 않게 하고,
   아래 돌바닥은 어두운 띠로 이어 버튼 자리를 만든다. */
#screen-title { background: #090c11; }
.title-art { position: absolute; inset: 0 0 auto 0; line-height: 0; }
.title-art img { display: block; width: 100%; height: auto; }
.title-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 15%;
  background: linear-gradient(180deg, rgba(9, 12, 17, 0) 0%, rgba(9, 12, 17, 0.55) 42%, rgba(9, 12, 17, 0.92) 78%, #090c11 100%);
}
.title-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 34% at 50% 15%, rgba(255, 249, 228, 0.5), rgba(255, 245, 218, 0.16) 55%, transparent 78%),
    linear-gradient(180deg, rgba(58, 34, 8, 0.2) 0%, rgba(58, 34, 8, 0.04) 16%, transparent 30%);
}
.title-inner {
  position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; text-align: center;
  padding: calc(42px + env(safe-area-inset-top)) 24px calc(18px + env(safe-area-inset-bottom));
}
#icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.title-head { display: flex; flex-direction: column; align-items: center; width: 100%; }
.title-kicker {
  margin: 0 0 10px; color: #4a3210; font-size: 12px; font-weight: 700; letter-spacing: 0.34em;
  text-shadow: 0 1px 2px rgba(255, 250, 232, 0.9), 0 0 12px rgba(255, 244, 210, 0.65);
}
.title-logo {
  font-family: var(--serif); font-weight: 900; font-size: clamp(25px, 9.6vw, 42px); line-height: 1.12; margin: 0;
  letter-spacing: 0.04em; color: #24180a; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 252, 242, 0.55), 0 3px 10px rgba(120, 72, 16, 0.35), 0 0 22px rgba(255, 240, 200, 0.8);
}
.title-logo span {
  display: block; font-size: 32px; letter-spacing: 0.24em; margin-top: 5px;
  color: #7d3517;
  text-shadow: 0 1px 0 rgba(255, 246, 222, 0.6), 0 3px 12px rgba(110, 50, 12, 0.3), 0 0 20px rgba(255, 236, 196, 0.75);
}
.title-sub {
  margin: 12px 0 0; color: #402a10; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(255, 250, 236, 0.88), 0 0 10px rgba(255, 246, 216, 0.6);
}
.title-bottom {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, rgba(9, 12, 17, 0) 0%, rgba(9, 12, 17, 0.78) 22%, #090c11 52%);
}
.title-actions { display: flex; flex-direction: column; gap: 8px; width: min(300px, 84%); }
.title-actions .btn-primary { padding: 14px; font-size: 17px; letter-spacing: 0.04em; }
.title-actions .btn-ghost { padding: 11px; font-size: 14px; }
.title-foot {
  margin: 12px 0 0; color: #b9a780; font-size: 10.5px; letter-spacing: 0.09em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ═══════════════ 1단계 지도 ═══════════════ */
#screen-map { background: #241d10; }
.map-top {
  position: relative; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 8px 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(38, 31, 17, 0.95), rgba(38, 31, 17, 0.82) 70%, rgba(38, 31, 17, 0));
}
/* v5.21 — 상단 자원 줄: 병력·금고가 5~6자리여도 아이콘·도감 버튼과 겹치지 않게 */
.map-top > .icon-btn { width: 34px; height: 34px; font-size: 16px; flex: 0 0 auto; }
.map-top .flag-chip { flex: 0 0 auto; padding: 2px 8px 2px 2px; gap: 4px; }
.map-top .flag-chip img { width: 26px; height: 26px; }
.map-top .flag-chip span { font-size: 14px; }
.flag-chip {
  display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 30px;
  background: rgba(246, 234, 208, 0.94); border: 1px solid var(--gold);
}
.flag-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.flag-chip span { font-family: var(--serif); font-weight: 900; color: var(--ink); font-size: 15px; }
.res-group { display: flex; gap: 5px; flex: 1; justify-content: center; }
.res { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #f4e4bd; min-width: 0; white-space: nowrap; }
.res i {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-style: normal; font-family: var(--serif);
  background: #3a3020; border: 1px solid var(--gold);
}
.res-ic { width: 19px; height: 19px; display: block; flex: 0 0 auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
.res.gold i { color: #ffd77a; }
.res.food i { color: #cbe6a8; }
.res.troop i { color: #a9c8ea; }
.date-ribbon {
  position: relative; z-index: 5; align-self: center; display: flex; align-items: center; gap: 10px;
  background: rgba(246, 234, 208, 0.94); border: 1px solid var(--gold); border-top: 0;
  border-radius: 0 0 12px 12px; padding: 3px 14px 4px; font-size: 11px; color: #4b3d22;
  font-family: var(--serif); font-weight: 700; margin-top: -1px;
}
.date-ribbon i { width: 1px; height: 10px; background: #b59b62; }

.world-viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none;
  background: radial-gradient(ellipse at 50% 42%, #3a2f1c 0%, #241d10 62%, #171207 100%);
  background-size: cover; background-position: center;
}
/* v5.41 — 지도 그림이 준비되면 지도 밖 여백을 같은 그림을 흡리게 이어 붙여 채운다.
   (예전에는 90px짜리 검은 띠가 지도 위쪽에 그대로 보였다) */
.world-viewport::before {
  content: ''; position: absolute; inset: -28px; pointer-events: none; z-index: 0;
  background-image: inherit; background-size: cover; background-position: center;
  filter: blur(16px) brightness(0.82) saturate(0.92);
  opacity: 0; transition: opacity 0.35s ease;
}
.world-viewport.has-bleed::before { opacity: 1; }
.world-layer {
  position: absolute; left: 0; top: 0; width: 2000px; height: 1333px; transform-origin: 0 0;
  will-change: transform; backface-visibility: hidden;
  box-shadow: 0 0 0 2px rgba(227, 189, 99, 0.35), 0 18px 60px rgba(0, 0, 0, 0.55);
}
#map-terrain, #map-territory, #map-features, #map-routes {
  position: absolute; left: 0; top: 0; display: block;
  width: 2000px; height: 1333px; pointer-events: none;
}

/* ── 거점 마커 (화면 좌표계 · 라벨 항상 표시 · 겹치면 자리를 옮기거나 잠시 감춤) ── */
.city-markers { position: absolute; inset: 0; pointer-events: none; --fs: 11px; --ih: 22px; --iw: 32px; }
.marker {
  position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; background: none; padding: 0;
  pointer-events: auto; overflow: visible;
}
.marker .m-hit {
  position: absolute; left: -21px; width: 42px; top: calc(var(--ih) * -1 - 8px);
  height: calc(var(--ih) + 16px); background: transparent; border-radius: 8px;
}
.marker .m-icon {
  position: absolute; left: 0; bottom: 0; width: auto; height: var(--ih);
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(24, 18, 6, 0.45));
  transition: transform 0.14s ease;
}
.marker:active .m-icon { transform: translateX(-50%) scale(0.95); }
.marker .m-flag {
  position: absolute; left: calc(var(--iw) * -0.46); top: calc(var(--ih) * -1 + 1px);
  width: 12px; height: 13px; display: grid; place-items: center;
  background: var(--fc, #8d8d8d);
  border: 1.4px solid rgba(255, 250, 232, 0.95);
  border-radius: 3px 3px 5px 5px;
  box-shadow: 0 1px 2px rgba(20, 14, 4, 0.55);
}
.marker .m-lv {
  font-family: var(--sans); font-size: 8px; font-weight: 800;
  color: #fffdf4; line-height: 1; letter-spacing: -0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.marker.lv-hi .m-flag { background: linear-gradient(180deg, var(--fc, #8d8d8d) 40%, #f3d477); }
.marker .m-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-family: var(--serif); font-weight: 800;
  font-size: var(--fs); line-height: 1.1; color: #fffaee; letter-spacing: -0.01em;
  padding: 0; background: none; border: 0;
  text-shadow:
    -1.1px -1.1px 0 #2a1e0c, 1.1px -1.1px 0 #2a1e0c, -1.1px 1.1px 0 #2a1e0c, 1.1px 1.1px 0 #2a1e0c,
    0 0 3px rgba(28, 20, 6, 0.9), 0 1px 3px rgba(0, 0, 0, 0.6);
  will-change: left, top;
}
.marker .m-label.off { opacity: 0; visibility: hidden; }
.marker.off { opacity: 0; pointer-events: none; }
.marker { transition: opacity 0.16s ease; }

.marker.mine .m-label { color: #fff6d6; }
.marker.enemy .m-label { color: #f6f1e4; }
.marker.neutral .m-label { color: #e6e0cd; }
.marker.mine .m-icon { filter: drop-shadow(0 2px 2px rgba(24, 18, 6, 0.45)) drop-shadow(0 0 4px rgba(255, 226, 150, 0.6)); }
.marker.sel { z-index: 6; }
.marker.sel .m-label { color: #ffe9b8; text-decoration: underline; text-decoration-color: rgba(255, 214, 120, 0.9); text-underline-offset: 2px; }
.marker.sel .m-icon { transform: translateX(-50%) scale(1.08); }
.marker.target::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 24px; height: 7px;
  transform: translateX(-50%); border-radius: 50%; border: 2px solid rgba(198, 62, 46, 0.85);
  animation: targetPulse 1.7s infinite;
}
@keyframes targetPulse { 0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(0.85); } 50% { opacity: 1; transform: translateX(-50%) scale(1.2); } }

/* v5.38 — 다시 오른쪽 세로 1열. 가로 한 줄(v5.26)은 성 정보 시트가 열렸을 때
   [출진·공격]·[정찰 보내기]·[닫기] 버튼 위를 그대로 덮었다(사용자 실기기 스샷).
   세로로 돌리되 버튼 34/27px·간격 4px로 묶어 v5.26이 걱정한 동쪽 해안 성 가림을
   5단 40px(200px+)에서 165px로 덜어 낸다. 시트가 열리면 통째로 숨긴다. */
.map-controls { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 12; }
.map-controls .round-btn { width: 34px; height: 34px; font-size: 16px; background: rgba(38, 31, 18, 0.82); }
.map-controls .round-btn.small { width: 27px; height: 27px; font-size: 12px; border-color: rgba(227, 189, 99, 0.5); }
/* v5.40 — 수도로 버튼: 세력 글자 대신 성·깃발 아이콘 + 작은 세력 배지 */
#go-capital { position: relative; display: grid; place-items: center; }
#go-capital .cap-ic { width: 15px; height: 15px; display: block; }
#go-capital .cap-ic { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
/* v5.40 — 행군 병력 보조 표기는 좁은 상단 줄에 맞춰 작게 */
#map-troops-march { font-size: 7px !important; opacity: 0.72; }
/* v5.38 — 성 정보 시트가 열려 있는 동안에는 지도 조작·범례가 비켜 준다 (시트 버튼을 가리지 않게).
   `:has()`를 모르는 브라우저에서는 콤마 선택자가 통째로 무시되므로 규칙을 나눠 둔다 —
   JS가 달아 주는 `#screen-map.sheet-open`만으로도 동작한다. */
#screen-map.sheet-open .map-controls { display: none; }
#screen-map.sheet-open .map-legend { display: none; }
#screen-map:has(#city-sheet:not([hidden])) .map-controls { display: none; }
#screen-map:has(#city-sheet:not([hidden])) .map-legend { display: none; }
/* v5.0.3 — 범례는 오른쪽 조작 버튼 위로 접어 둔다 (남쪽 거점을 가리지 않게) */
.map-legend {
  position: absolute; right: 64px; bottom: 26px; z-index: 6;
  display: grid; grid-template-columns: 1fr; gap: 4px 10px;
  padding: 7px 10px; border-radius: 10px; background: rgba(32, 26, 15, 0.90);
  border: 1px solid rgba(227, 189, 99, 0.55); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  color: #f0e0b8; font-size: 9.5px; letter-spacing: 0.04em; max-width: 168px;
  animation: legendIn 0.16s ease-out;
}
.map-legend[hidden] { display: none; }
@keyframes legendIn { from { opacity: 0; transform: translateY(4px); } }
#legend-toggle { font-size: 12px; line-height: 1; }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.lg-img { width: 18px; height: 13px; object-fit: contain; display: inline-block; vertical-align: -2px;
  filter: drop-shadow(0 1px 1px rgba(20, 14, 4, 0.4)); }
.lg.capital { background: #e3bd63; }
.lg.town { background: #cbb180; }
.lg.pass { background: #a9b6a0; }
.lg.fort { background: #b58a5a; }
.lg.neutral { background: #8b8777; border: 1px solid #d8d2be; }

.city-sheet {
  position: absolute; left: 8px; right: 8px; bottom: 76px; z-index: 8;
  background: linear-gradient(180deg, #f9efd8, #ecd9b1);
  border: 1px solid var(--gold); border-radius: 16px; padding: 10px 12px 12px;
  box-shadow: 0 14px 34px rgba(24, 18, 6, 0.45);
  animation: sheetUp 0.25s ease;
}
@keyframes sheetUp { from { transform: translateY(16px); opacity: 0; } }
.sheet-grip { width: 34px; height: 3px; border-radius: 3px; background: #c3a875; margin: 0 auto 8px; }
.sheet-head { display: flex; align-items: center; gap: 9px; }
.faction-badge {
  width: 33px; height: 33px; border-radius: 8px; display: grid; place-items: center;
  color: #fff6e0; font-family: var(--serif); font-size: 16px; font-weight: 900;
  background: var(--fc, #666); border: 1px solid rgba(255, 245, 220, 0.7);
}
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h3 { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink); }
.sheet-title h3 em { font-size: 12px; color: #8a7448; margin-left: 4px; }
.sheet-title p { margin: 1px 0 0; font-size: 10.5px; color: #7b6538; }
.sheet-close { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #c4a870; background: #f1e2c0; color: #7a6236; font-size: 13px; }
.sheet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }
.sheet-stats div { background: rgba(255, 251, 240, 0.55); border: 1px solid rgba(184, 134, 47, 0.35); border-radius: 8px; padding: 5px 4px; text-align: center; }
.sheet-stats span { display: block; font-size: 9.5px; color: #806a3c; }
.sheet-stats b { font-size: 14px; color: #33280f; font-family: var(--serif); }
.sheet-gens { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.mini-gen { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; background: rgba(255, 250, 238, 0.6); border: 1px solid rgba(184, 134, 47, 0.3); border-radius: 20px; padding: 2px 8px 2px 2px; }
.mini-gen img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.mini-gen div { display: flex; flex-direction: column; line-height: 1.2; }
.mini-gen span { font-size: 10px; color: #5c4b27; font-weight: 700; }
.mini-gen em { font-size: 7.5px; font-style: normal; color: #8a7448; letter-spacing: -0.02em; }
.sheet-actions { display: flex; gap: 8px; margin-top: 9px; }
.sheet-actions .btn { flex: 1; padding: 11px 8px; font-size: 14px; }

.map-bottom {
  position: relative; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, #241d10 30%, rgba(36, 29, 16, 0.92) 70%, rgba(36, 29, 16, 0));
}
.map-hint { flex: 1; min-width: 0; color: #d8c496; font-size: 10.5px; line-height: 1.4; letter-spacing: -0.01em;
  word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-next {
  border: 1px solid #e3bd63; border-radius: 10px; padding: 10px 15px; font-size: 13px; font-weight: 800;
  color: #2c2310; background: linear-gradient(180deg, #f0d79b, #d7ae58);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-next:active { transform: translateY(1px); }
.btn-capital {
  flex: 0 0 auto; border: 1px solid #e3bd63; border-radius: 10px; padding: 9px 12px;
  font-size: 12px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap;
  color: #ffe6ac; background: linear-gradient(180deg, #4a3a1c, #2e2410);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 226, 160, 0.18);
}
.btn-capital:active { transform: translateY(1px); }

/* ── v5.36 — 지도 타겟 선택(출진·정찰·전출·수송·계략) ───────────────── */
#screen-map.picking .map-bottom { display: none; }
#screen-map.picking .city-sheet { display: none; }
#screen-map.picking #econ-strip { display: none; }
/* 고르는 동안에는 조작 버튼을 위로 올리고 범례는 접는다 — 아래 띠(안내 바) 자리를 비운다 */
#screen-map.picking .map-controls { top: 8px; bottom: auto; }
#screen-map.picking .map-legend { display: none; }

/* 고를 수 있는 성 — 금빛 테두리가 천천히 숨쉬고, 아이콘 위에 배지가 붙는다 */
.marker .m-badge {
  position: absolute; left: 0; bottom: calc(var(--ih) + 3px); transform: translateX(-50%);
  padding: 1px 5px 1.5px; border-radius: 6px; white-space: nowrap;
  font-family: var(--sans); font-size: 8.5px; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em;
  color: #33270f; background: linear-gradient(180deg, #ffe9b0, #e3bd63);
  border: 1px solid #fff3cf; box-shadow: 0 2px 5px rgba(20, 14, 4, 0.55);
  pointer-events: none; z-index: 3;
}
.marker .m-badge[hidden] { display: none; }
.marker.pickable { z-index: 5; }
.marker.pickable .m-icon {
  filter: drop-shadow(0 2px 2px rgba(24, 18, 6, 0.5)) drop-shadow(0 0 5px rgba(255, 206, 108, 0.95));
  animation: pickGlow 1.7s ease-in-out infinite;
}
.marker.pickable .m-label { color: #fff2c8; }
.marker.pickable::before {
  content: ""; position: absolute; left: 0; top: calc(var(--ih) * -0.5); width: calc(var(--iw) + 14px); height: calc(var(--ih) + 16px);
  transform: translate(-50%, -6px); border-radius: 12px;
  border: 1.6px solid rgba(240, 200, 110, 0.85); background: rgba(255, 214, 120, 0.10);
  animation: pickRing 1.7s ease-in-out infinite; pointer-events: none;
}
@keyframes pickGlow { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.07); } }
@keyframes pickRing { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
/* 고를 수 없는 성은 가라앉힌다 */
.marker.pick-off { opacity: 0.34; }
.marker.pick-off .m-badge { display: none; }
/* 출발 성 표식 — 여기서 보낸다는 것만 파란 점선으로 조용히 알린다 */
.marker.pick-origin { opacity: 1; z-index: 4; }
.marker.pick-origin .m-label { color: #d8f0ff; }
.marker.pick-origin .m-flag { box-shadow: 0 0 0 2px rgba(150, 210, 255, 0.85); }
.marker.pick-origin::before {
  content: ""; position: absolute; left: 0; top: calc(var(--ih) * -0.5); width: calc(var(--iw) + 14px); height: calc(var(--ih) + 16px);
  transform: translate(-50%, -6px); border-radius: 12px; pointer-events: none;
  border: 1.6px dashed rgba(150, 210, 255, 0.9); background: rgba(120, 190, 255, 0.10);
}
.marker.pick-origin .m-badge {
  color: #12314a; background: linear-gradient(180deg, #d8efff, #93c8f2); border-color: #eaf6ff;
}

.map-pick-bar {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 14;
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 12px 10px; border-radius: 14px;
  border: 1px solid #e3bd63;
  background: linear-gradient(180deg, rgba(48, 38, 21, 0.97), rgba(28, 22, 11, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 226, 160, 0.14);
  color: #f4e6c0; animation: pickBarIn 0.18s ease-out;
}
.map-pick-bar[hidden] { display: none; }
@keyframes pickBarIn { from { opacity: 0; transform: translateY(12px); } }
.pk-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pk-kicker { flex: 0 0 auto; font-size: 9px; letter-spacing: 0.08em; color: #bda679; }
.pk-title { font-family: var(--serif); font-size: 15px; color: #ffe9b8; letter-spacing: -0.01em; }
.pk-hint { margin: 0; font-size: 10px; line-height: 1.42; color: #d8c496; word-break: keep-all; overflow-wrap: anywhere; }
.pk-hint b { color: #ffe0a0; }
.pk-foot { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.pk-count { flex: 1; min-width: 0; font-size: 9.5px; color: #ab9873; }
.pk-cancel {
  flex: 0 0 auto; border: 1px solid #c0a166; border-radius: 9px; padding: 7px 15px;
  font-size: 12px; font-weight: 800; letter-spacing: -0.01em; color: #ffe6ac;
  background: linear-gradient(180deg, #4a3a1c, #2e2410);
}
.pk-cancel:active { transform: translateY(1px); }

/* ═══════════════ 2단계 내정 ═══════════════ */
#screen-city { background: #efe0bf; overflow: hidden; }
/* v5.6 — 가운데(성 그림·내정 정보·장수 줄)만 스크롤하고, 하단 6버튼은 화면 아래에 고정한다.
   390×680(안드로이드 크롬 주소창+하단바 제외)에서도 6버튼이 1px도 잘리지 않는다. */
.city-mid {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.city-mid > .city-scene { flex: 1 1 auto; min-height: 150px; }
.city-mid > .city-dev, .city-mid > .city-slots, .city-mid > .city-info,
.city-mid > .city-general-strip, .city-mid > .city-ap { flex: 0 0 auto; }
.city-top {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #faf0d9, #eddbb4);
  border-bottom: 1px solid rgba(184, 134, 47, 0.45);
  box-shadow: 0 3px 12px rgba(90, 70, 30, 0.16);
  position: relative; z-index: 3;
}
.city-top .icon-btn { background: #f3e4c2; color: #5b4a27; border-color: #c3a568; }
.city-lord { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--gold); box-shadow: 0 2px 6px rgba(80, 60, 20, 0.25); }
.city-lord img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.city-title-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-line1, .ct-line2 { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ct-line1 { gap: 3px; overflow: visible; }
.ct-line2 { flex-wrap: wrap; row-gap: 2px; }
.ct-line1 > *, .ct-line2 > * { flex: 0 0 auto; }
.city-title-wrap h2 { margin: 0; font-family: var(--serif); font-size: 19px; letter-spacing: 0.01em; color: #2c2412; white-space: nowrap; cursor: pointer; }
/* v5.50 — 2~4자 성 이름이 '영..'으로 잘리지 않게: 이름은 줄지 않고, 앞뒤 ◀▶만 작게 */
@media (max-width: 380px) { .city-title-wrap h2 { font-size: 17px; } }
.city-title-wrap h2:active { color: #8a5f2a; }
/* v5.7 — 성 화면 안에서 내 거점을 ◀ ▶ 로 넘긴다 */
.city-step {
  width: 20px; height: 20px; flex: 0 0 20px; padding: 0; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid #c3a568; background: #f7e9ca; color: #7a5f24;
  font-size: 9px; line-height: 1; box-shadow: 0 1px 2px rgba(90, 70, 30, 0.18);
}
.city-step:active { background: #efdcb0; }
.city-step:disabled { opacity: 0.28; }
.city-stepno { font-size: 8.5px; font-weight: 800; color: #8b7445; letter-spacing: 0.02em; }
.city-pick-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid #d3bb8a; border-radius: 9px; background: rgba(255, 252, 244, 0.82); padding: 7px 9px; margin-bottom: 5px; }
.city-pick-row.on { border-color: #47673c; background: #f2f7e6; box-shadow: inset 0 0 0 1px #47673c; }
.city-pick-row .cp-lv { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; display: grid; place-items: center;
  color: #fff8e8; font-size: 10px; font-weight: 900; }
.city-pick-row .cp-main { flex: 1; min-width: 0; }
.city-pick-row .cp-main b { display: block; font-family: var(--serif); font-size: 13px; color: #2e2510; }
.city-pick-row .cp-main span { font-size: 9px; color: #7b6538; }
.city-pick-row .cp-cap { flex: 0 0 auto; font-size: 9px; font-weight: 800; color: #8a5f2a; }
/* v5.29 — 후반 다성(20성+) 거점 목록: 총계·필터·손볼 곳 표시 */
.cp-sum { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 2px 0 5px; padding: 5px 8px; border-radius: 8px;
  background: rgba(255, 250, 238, 0.8); border: 1px solid #dcc9a0; }
.cp-sum span { font-size: 8.5px; color: #7b6538; }
.cp-sum b { font-size: 10px; color: #4a3a16; }
.cp-chips { display: flex; gap: 5px; margin: 0 0 6px; }
.cp-chips button { flex: 1; padding: 5px 4px; border-radius: 8px; border: 1px solid #c9ae7c;
  background: #fbf3e0; color: #6b5a2a; font-size: 9px; font-weight: 800; }
.cp-chips button.on { background: #47673c; border-color: #35512c; color: #f6f0dc; }
.city-pick-row .cp-front { font-style: normal; font-size: 8px; font-weight: 800; color: #a8443a;
  border: 1px solid #d9a096; border-radius: 7px; padding: 0 4px; margin-left: 2px; }
.city-pick-row .cp-need { display: block; font-size: 8.5px; color: #a8443a; margin-top: 1px; }
.city-title-wrap #city-hanja { font-family: var(--sans); font-size: 9px; font-weight: 800; color: #8b7445; white-space: nowrap; background: #efe2c4; border: 1px solid #cdb489; border-radius: 7px; padding: 0 5px; }
/* v5.18 — 성 이름 옆 '대도시 · 3중 성벽' 배지가 우측 금/군량 숫자와 붙지 않게:
   제목 줄은 넘칠 때 배지를 줄이고(줄임표), 배지와 자원 열 사이에 숨 쉴 틈을 둔다 */
.city-title-wrap { min-width: 0; }
.ct-line1 { min-width: 0; overflow: visible; }
.ct-line1 #city-hanja { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 92px; margin-left: 2px; }
.ct-line1 #city-name, .city-title-wrap #city-name { flex: 0 0 auto; min-width: 0; overflow: visible; text-overflow: clip; }
.city-top .city-res { padding-left: 4px; }
.faction-tag {
  align-self: center; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  color: #fff8e8; font-family: var(--serif); font-weight: 900; font-size: 12px;
}
.city-res { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; flex: 0 0 auto; margin-left: 2px; }
.city-res .res { color: #4a3c1d; font-size: 10.5px; }
.city-res .res-ic { width: 15px; height: 15px; }

.city-scene { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #a9b58a; }
.city-scene > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; transform: scale(1.03); animation: kenburns 26s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.09) translateY(-8px); } }
.scene-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(40, 30, 12, 0.28) 0%, transparent 22%, transparent 62%, rgba(40, 30, 12, 0.42) 100%); }
.scene-hotspots { position: absolute; inset: 0; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%); border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.hotspot i {
  width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 243, 205, 0.92);
  border: 2px solid #8a6a28; box-shadow: 0 0 0 4px rgba(255, 240, 190, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: hop 2.4s ease-in-out infinite;
}
.hotspot span {
  font-size: 10px; font-weight: 800; color: #fff8e4; letter-spacing: 0.02em;
  padding: 2px 7px; border-radius: 20px; background: rgba(40, 32, 16, 0.7);
  border: 1px solid rgba(227, 189, 99, 0.5); white-space: nowrap;
}
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.city-weather {
  position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 20px;
  background: rgba(246, 234, 208, 0.9); border: 1px solid rgba(184, 134, 47, 0.5);
  font-size: 10px; font-weight: 700; color: #5b4a26;
}
.city-dev { background: linear-gradient(180deg, #f8eed8, #f1e3c4); border-top: 1px solid rgba(184, 134, 47, 0.45); padding: 5px 10px 6px; }
.dev-head { display: flex; align-items: center; gap: 7px; }
.dev-lv {
  font-family: var(--serif); font-size: 12px; font-weight: 900; color: #fff6df;
  background: linear-gradient(180deg, #7a5a2a, #5c431c); border: 1px solid #e3bd63;
  border-radius: 7px; padding: 1px 7px; letter-spacing: 0.01em;
}
.dev-lv em { font-size: 8px; font-style: normal; color: #e6cf9a; }
.dev-name { flex: 1; font-family: var(--serif); font-size: 12px; color: #4a3a1a; letter-spacing: -0.01em; }
.dev-pop { font-size: 9.5px; color: #7b6538; }
.dev-pop b { font-family: var(--serif); font-size: 12px; color: #33280f; }
.dev-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.dev-cell { display: flex; align-items: center; gap: 5px; }
.dev-label { flex: 0 0 24px; font-size: 8.5px; color: #85703f; font-weight: 700; }
.dev-bar { flex: 1; height: 5px; border-radius: 3px; background: #ddcba4; overflow: hidden; }
.dev-bar em { display: block; height: 100%; border-radius: 3px; transition: width 0.3s; }
.dev-val { flex: 0 0 20px; text-align: right; font-size: 8.5px; color: #4a3d20; font-weight: 700; }
.city-info { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px 6px; background: #f2e4c6; border-top: 1px solid rgba(184, 134, 47, 0.25); }
.ci-item { font-size: 9px; color: #7b6538; white-space: nowrap; }
.ci-item b { font-family: var(--serif); font-size: 11.5px; color: #33280f; }
.ci-item b.full { color: #a8443a; }
.ci-item em { font-style: normal; font-size: 8px; color: #9a8a66; }
.city-level {
  align-self: center; font-family: var(--serif); font-size: 10px; font-weight: 900; color: #fff6df;
  background: linear-gradient(180deg, #7a5a2a, #5c431c); border: 1px solid #e3bd63;
  border-radius: 6px; padding: 0 5px;
}
.city-level[data-lv="5"] { background: linear-gradient(180deg, #b8862f, #8a5f1d); }

.city-general-strip { display: flex; gap: 7px; overflow-x: auto; padding: 8px 10px; background: #f2e4c6; min-height: 66px; align-items: center; }
.city-general-strip::-webkit-scrollbar { display: none; }
.gen-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 30px; background: rgba(255, 252, 244, 0.85); border: 1px solid #cfb47d; box-shadow: 0 2px 5px rgba(90, 70, 30, 0.12); }
.gen-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 1px solid #b8862f; }
.gen-chip b { display: block; font-size: 12px; color: #33280f; line-height: 1.2; }
.gen-chip span { display: block; font-size: 9px; color: #86703f; }
.gen-chip .gc-stats { display: flex; gap: 4px; margin-top: 1px; font-style: normal; }
.gen-chip .gc-stats i { font-style: normal; font-size: 8px; font-weight: 700; color: #6b5830; letter-spacing: -0.02em; }
.empty-gens { font-size: 11px; color: #8a7648; margin: 0; }

.city-commands {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #f6ead0, #ead7b0);
  border-top: 1px solid rgba(184, 134, 47, 0.55);
  box-shadow: 0 -4px 14px rgba(90, 70, 30, 0.12);
  flex: 0 0 auto;                 /* 하단 6버튼은 절대 줄어들지 않는다 */
  position: relative; z-index: 4;
}
.cmd { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; border-radius: 9px; }
.cmd:active { background: rgba(184, 134, 47, 0.14); }
.cmd b { font-size: 11.5px; color: #3a2d15; letter-spacing: -0.03em; }
.cmd small { font-size: 8px; color: #8a7444; letter-spacing: -0.02em; }
.cmd.sortie b { color: #8a2f22; }
.cmd-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(180deg, #fffaf0, #ecdbb8); border: 1px solid #b99a5e;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(90, 70, 30, 0.15);
  background-repeat: no-repeat; background-position: center; background-size: 22px 22px; }
.cmd.sortie .cmd-ic { background: linear-gradient(180deg, #b4553f, #8a3629); border-color: #5e2018; }
.ic-farm { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f6b35' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M12 21V10'/%3E%3Cpath d='M12 10c0-3 2-5 5-5 0 3-2 5-5 5z'/%3E%3Cpath d='M12 14c0-3-2-5-5-5 0 3 2 5 5 5z'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E"); }
.ic-trade { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a67b25' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3Cpath d='M9 9h5M9.5 12h5M9 15h5'/%3E%3C/svg%3E"); }
.ic-troop { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23546f96' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 5h11l-2 3 2 3H5'/%3E%3Cpath d='M3 21h9'/%3E%3C/svg%3E"); }
.ic-talent { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5a35' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.4'/%3E%3Cpath d='M5.5 20c.8-3.6 3.3-5.4 6.5-5.4s5.7 1.8 6.5 5.4'/%3E%3C/svg%3E"); }
.ic-train { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b5a2c' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M5 5h9a2 2 0 0 1 2 2v12H7a2 2 0 0 1-2-2z'/%3E%3Cpath d='M8 8h5M8 11h5M8 14h3'/%3E%3Cpath d='M16 7l3 3'/%3E%3C/svg%3E"); }
.ic-repair { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6350' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M4 20l4-4'/%3E%3Cpath d='M9 6l9 9-2.5 2.5-9-9z'/%3E%3Cpath d='M15 3l6 6-2 2-6-6z'/%3E%3C/svg%3E"); }
.ic-sortie { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffe9c2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20L20 4'/%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M4 14l6 6'/%3E%3C/svg%3E"); }
.ic-map { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f6b35' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M4 6l5-2 6 2 5-2v14l-5 2-6-2-5 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E"); }

/* ═══════════════ 4단계 전장 ═══════════════ */
#screen-battle { background: #241d10; }
.battle-top {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  padding-top: calc(7px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #3a2f1a, #2b2313);
  border-bottom: 1px solid rgba(227, 189, 99, 0.4); color: #f4e4bd;
}
.battle-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.battle-title b { font-family: var(--serif); font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-title small { font-size: 9.5px; color: #c6ad7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-turnbox { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 6px 2px; border-radius: 10px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(72, 56, 24, 0.9), rgba(22, 17, 8, 0.92));
  border: 1px solid rgba(240, 200, 110, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 232, 170, 0.22); }
/* v5.38 — 턴 수를 13px 얇은 글씨에서 20px 굵은 금빛으로. 390px 폰에서도 한눈에 읽힌다 */
.battle-turnbox span { font-family: var(--serif); font-size: 20px; font-weight: 900; color: #fff7dc; line-height: 1.12; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(255, 206, 110, 0.75), 0 1px 0 #4a3510; }
.battle-turnbox em { font-size: 10.5px; padding: 2px 10px; border-radius: 10px; background: #2f6fd0; color: #f4f9ff; font-weight: 900;
  letter-spacing: 0.02em; box-shadow: 0 0 0 1px rgba(160, 205, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.battle-turnbox em.enemy { background: #c0392b; box-shadow: 0 0 0 1px rgba(255, 175, 155, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
/* 적군 페이즈에는 턴 상자도 붉게 물들어 지금 누구 차례인지 색으로도 보인다 */
.battle-turnbox.enemy { border-color: rgba(255, 150, 125, 0.85); background: radial-gradient(120% 120% at 50% 0%, rgba(96, 34, 24, 0.92), rgba(34, 12, 8, 0.94)); }
.battle-turnbox.enemy span { color: #ffd9cd; text-shadow: 0 0 10px rgba(255, 138, 108, 0.75), 0 1px 0 #43110a; }

.battle-armies { display: flex; align-items: center; gap: 7px; padding: 4px 10px; background: #2f2715; }
.army { flex: 1; display: flex; align-items: center; gap: 5px; }
.army b { font-size: 10px; color: #e9d7ac; min-width: 12px; text-align: center; }
.army-flag { min-width: 30px; height: 18px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center; font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: -0.02em; color: #fff6df; }
.army.ally .army-flag { background: #2f6fd0; box-shadow: 0 0 0 1px rgba(150, 200, 255, 0.65); }
.army.enemy .army-flag { background: #c0392b; box-shadow: 0 0 0 1px rgba(255, 170, 150, 0.6); }
.army-bar { flex: 1; height: 5px; border-radius: 3px; background: #191308; overflow: hidden; }
.army-bar i { display: block; height: 100%; width: 100%; transition: width 0.35s; }
.ally .army-bar i { background: linear-gradient(90deg, #5d8fd8, #9cc2f5); }
.enemy .army-bar i { background: linear-gradient(90deg, #d37562, #f0a893); }

.battle-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #1e180d; touch-action: none; }
#battle-canvas { position: absolute; inset: 0; display: block; }
.battle-objective {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 2;
  padding: 4px 12px; border-radius: 12px; background: rgba(36, 29, 16, 0.82);
  border: 1px solid rgba(227, 189, 99, 0.55); color: #f2e2b8; font-size: 10px;
  white-space: normal; text-align: center; line-height: 1.3; overflow-wrap: anywhere;
  max-width: 84%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.battle-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.battle-tip {
  position: absolute; left: 8px; bottom: 8px; max-width: 62%; padding: 5px 9px; border-radius: 8px;
  background: rgba(36, 29, 16, 0.82); color: #e8d7ad; font-size: 9.5px; line-height: 1.35;
  border: 1px solid rgba(227, 189, 99, 0.3); z-index: 2;
}
.turn-banner {
  position: absolute; left: 0; right: 0; top: 38%; text-align: center; pointer-events: none;
  font-family: var(--serif); font-size: 30px; font-weight: 900; letter-spacing: 0.2em;
  color: #fff3cf; text-shadow: 0 2px 0 #4a3510, 0 8px 24px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: scale(0.92); transition: opacity 0.3s, transform 0.4s; z-index: 3;
}
.turn-banner.show { opacity: 1; transform: scale(1); }
.turn-banner.enemy { color: #ffd3c6; }

.battle-bottom {
  background: linear-gradient(180deg, #f7ecd3, #e8d4ac);
  border-top: 2px solid #b8862f;
  padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px;
}
.unit-card { display: flex; gap: 8px; align-items: center; min-height: 62px; }
.uc-portrait { position: relative; width: 54px; height: 54px; border-radius: 9px; overflow: hidden; border: 1.5px solid #b8862f; background: #d9c39a; }
.uc-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.uc-portrait span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(38, 30, 14, 0.78); color: #ffe6ac; font-size: 8px; text-align: center; padding: 1px 0; }
.uc-main { flex: 1; min-width: 0; }
.uc-row { display: flex; align-items: baseline; gap: 5px; }
.uc-row b { font-family: var(--serif); font-size: 15px; color: #2d2410; }
.uc-row span { font-size: 9.5px; color: #7b6538; }
#uc-terrain { margin-left: auto; font-size: 8.5px; color: #4e6a3c; text-align: right; max-width: 46%; }
.uc-bars { display: flex; flex-direction: column; gap: 2px; margin: 2px 0; }
.hpbar, .mpbar { position: relative; height: 11px; border-radius: 4px; background: #c9b287; overflow: hidden; }
.hpbar i { display: block; height: 100%; background: linear-gradient(180deg, #6fbf6a, #479144); transition: width 0.3s; }
.mpbar { height: 7px; }
.mpbar i { display: block; height: 100%; background: linear-gradient(180deg, #7fb8e8, #4d86c0); }
.hpbar em, .mpbar em { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7.5px; font-weight: 800; color: #18200f; letter-spacing: 0.02em; }
/* v5.0.3 — 전투 HUD 경험치 바 (금빛) */
.expbar { position: relative; height: 9px; border-radius: 4px; background: #c9b287; overflow: hidden; }
.expbar i { display: block; height: 100%; background: linear-gradient(180deg, #f0cf78, #b8862f); transition: width 0.3s; }
.expbar em { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7px; font-weight: 800; color: #2a1d06; letter-spacing: 0.02em; }
.uc-meta { display: flex; gap: 8px; font-size: 9px; color: #6a5732; margin: 1px 0 1px; }
.uc-meta b { color: #3b2e13; font-variant-numeric: tabular-nums; }
.uc-stats { display: flex; gap: 8px; font-size: 9px; color: #6a5732; }
/* v5.0.3 — 전투 중 적용된 강화·약화 표시 (방패벽·지휘·요술 등) */
.uc-buffs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; min-height: 0; }
.uc-buffs:empty { display: none; }
.uc-buffs .bf {
  font-size: 8.5px; font-weight: 800; line-height: 1; padding: 2px 5px; border-radius: 8px;
  background: rgba(86, 140, 196, 0.20); border: 1px solid rgba(150, 200, 255, 0.55); color: #dcefff;
}
.uc-buffs .bf.bad { background: rgba(190, 80, 80, 0.22); border-color: rgba(255, 160, 150, 0.6); color: #ffe1da; }
.uc-buffs .bf.good { background: rgba(96, 170, 110, 0.22); border-color: rgba(160, 230, 170, 0.55); color: #e2ffe6; }
/* v5.33 — 전투 중 실시간으로 쌓인 경험치 알약 */
.uc-buffs .bf.exp { background: rgba(214, 168, 70, 0.24); border-color: rgba(255, 214, 120, 0.65); color: #fff2cd; }

.uc-stats b { color: #3b2e13; }
.battle-actions { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.act {
  border: 1px solid #b99a5e; border-radius: 9px; padding: 5px 1px 4px; background: linear-gradient(180deg, #fffaf0, #e9d7b2);
  display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 2px 4px rgba(90, 70, 30, 0.14);
}
.act span { font-family: var(--serif); font-size: 13px; font-weight: 900; color: #6b4d18; line-height: 1; }
.act-ic { width: 17px; height: 17px; display: block; }
.act b { font-size: 10px; color: #3a2d15; }
.act.auto { background: linear-gradient(180deg, #e8dcb8, #d5c191); border-color: #8a7448; }
.act.auto span { font-size: 14px; color: #4a3a1a; }
.act.auto.active { background: linear-gradient(180deg, #7fc08a, #4f8a5c); border-color: #2c5b36; }
.act.auto.active b, .act.auto.active span { color: #f4ffe8; }
.act.active { background: linear-gradient(180deg, #ffe6a8, #dfae52); border-color: #8a621e; }
.act.off { opacity: 0.42; }
/* v5.36 — [군량 (2)] 이 부대의 남은 횟수를 버튼에 적는다 (0이면 흐리게 잠김) */
.act.item b { white-space: nowrap; letter-spacing: -0.03em; }
.act.item.empty { opacity: 0.5; background: linear-gradient(180deg, #efe6d2, #dccfb1); }
.act.item.empty b { color: #8a7a5c; }
.act.endturn { background: linear-gradient(180deg, #5a7a4a, #3a5530); border-color: #24371d; }
.act.endturn b { color: #f4ecd2; }
/* v5.54 — S급 고유 필살기 버튼: 쓸 수 있을 때만 금빛으로 빛난다 (1/1 → 0/1) */
.act.ult { background: linear-gradient(180deg, #efe0b4, #d9c08a); border-color: #8a7448; position: relative; flex-direction: column; gap: 0; }
.act.ult span { font-size: 13px; line-height: 1; color: #7a5a12; }
.act.ult b { font-size: 9.5px; letter-spacing: -0.04em; }
.act.ult em { font-size: 8px; font-weight: 900; color: #6b5426; line-height: 1.1; font-variant-numeric: tabular-nums; }
.act.ult.ready { background: linear-gradient(180deg, #ffe9a8, #e0a63a); border-color: #8a5a12;
  box-shadow: 0 0 0 1px rgba(255, 236, 160, 0.55), 0 0 10px rgba(255, 196, 74, 0.55), inset 0 1px 0 rgba(255, 250, 220, 0.7); }
.act.ult.ready span { color: #8a3c0a; }
.act.ult.ready em { color: #6b3a06; }
.act.ult.ready.active { background: linear-gradient(180deg, #ffd76a, #cf8a1c); }
.act.ult.off { opacity: 0.5; }
/* v5.65 — 고유 필살기가 없는 일반 장수: 활성처럼 보이지 않게 회색 잠금 */
.act.ult.locked, .act.ult.off.locked {
  opacity: 1; background: linear-gradient(180deg, #e7e3d7, #cbc6b8);
  border-color: #a49c88; box-shadow: none; filter: grayscale(0.9);
}
.act.ult.locked span { color: #8c8574; }
.act.ult.locked b { color: #7a7464; }
.act.ult.locked em { color: #8c8574; }

/* v5.54 — 필살기 컷인 배너 (전장 위에 잠깐 지나간다) */
.ult-cutin { position: absolute; left: 0; right: 0; top: 8%; z-index: 6; pointer-events: none;
  display: flex; justify-content: center; opacity: 0; transform: translateY(-10px) scale(0.94);
  transition: opacity 0.18s ease-out, transform 0.24s cubic-bezier(.2,.9,.3,1.2); }
.ult-cutin.show { opacity: 1; transform: translateY(0) scale(1); }
.ult-band { display: flex; align-items: center; gap: 9px; max-width: 92%;
  padding: 8px 12px 8px 8px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(38, 26, 10, 0.95), rgba(22, 16, 8, 0.92) 62%, rgba(48, 32, 12, 0.9));
  border: 1.5px solid rgba(var(--ult-c, 255, 220, 140), 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(var(--ult-c, 255, 220, 140), 0.45), inset 0 1px 0 rgba(255, 244, 210, 0.22); }
.ult-face { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; flex: none;
  border: 1.5px solid rgba(var(--ult-c, 255, 220, 140), 0.85); background: #2a2010; }
.ult-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.ult-lines { display: flex; flex-direction: column; min-width: 0; line-height: 1.18; }
.ult-lines .ult-side { font-size: 8.5px; font-weight: 900; letter-spacing: 0.06em; color: #ffd98a; }
.ult-lines .ult-side.enemy { color: #ff9c8a; }
.ult-lines b { font-family: var(--serif); font-size: 12.5px; color: #f6e7c2; }
.ult-lines strong { font-family: var(--serif); font-size: 16px; font-weight: 900; letter-spacing: -0.01em;
  color: rgb(var(--ult-c, 255, 220, 140)); text-shadow: 0 0 12px rgba(var(--ult-c, 255, 220, 140), 0.55), 0 1px 0 #2a1c08; }
.ult-lines span#ult-line { font-size: 10px; color: #e6d3a8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act.endturn span { color: #ffe9b0; }

.battle-overlay { position: absolute; inset: 0; z-index: 10; background: linear-gradient(180deg, rgba(24, 18, 8, 0.2), rgba(24, 18, 8, 0.55)); display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 8px; padding: 14px; }
.battle-overlay[hidden] { display: none; }
.intro-card { width: 100%; display: flex; gap: 10px; align-items: flex-end; animation: introIn 0.25s ease; }
@keyframes introIn { from { opacity: 0; transform: translateY(14px); } }
.ic-portrait {
  width: 92px; height: 108px; object-fit: cover; object-position: 50% 16%; border-radius: 10px 10px 4px 4px;
  border: 2px solid #e3bd63; background: #2b2313; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.intro-card.enemy .ic-portrait { border-color: #d07a66; }
.ic-box {
  flex: 1; background: rgba(246, 234, 208, 0.96); border: 1px solid #b8862f; border-radius: 12px;
  padding: 10px 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); min-height: 96px;
  display: flex; flex-direction: column;
}
.ic-name { font-family: var(--serif); font-weight: 900; font-size: 15px; color: #2e2410; }
.ic-name em { font-size: 10px; color: #8a7448; margin-left: 4px; }
.ic-text { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #3a2f1a; flex: 1; }
.ic-tap { align-self: flex-end; font-size: 9px; color: #8a7448; animation: blink 1.4s infinite; }
/* v5.65 — 인트로 대사 [건너뛰기 ⏭] */
.intro-skip {
  align-self: flex-end; flex: 0 0 auto; z-index: 3;
  padding: 7px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(52, 38, 12, 0.92), rgba(34, 24, 8, 0.94));
  border: 1.4px solid #e3bd63; color: #ffeec2; font-size: 11.5px; font-weight: 900;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.intro-skip:active { transform: translateY(1px); }
@keyframes blink { 50% { opacity: 0.35; } }

/* ═══════════════ 모달 ═══════════════ */
#modal-root { position: relative; z-index: 50; }
.modal-layer {
  position: fixed; inset: 0; background: rgba(24, 19, 9, 0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity 0.18s;
}
.modal-layer.in { opacity: 1; }
.modal-layer.out { opacity: 0; }
.modal {
  width: 100%; max-width: 380px; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #fbf2dd, #eddcb8);
  border: 1px solid #b8862f; border-radius: 16px; padding: 16px 15px 14px;
  box-shadow: 0 20px 50px rgba(20, 14, 4, 0.55);
  transform: translateY(10px) scale(0.98); transition: transform 0.22s;
}
/* v5.35 — 창 본문만 굴리고 [확인]·[닫기]는 늘 화면 아래에 붙박아 둔다
   (징병·탐색·시설처럼 목록이 긴 창에서 버튼이 화면 밖으로 밀려나던 문제) */
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.modal-layer.in .modal { transform: none; }
.modal.wide { max-width: 430px; }
.modal-kicker { margin: 0 0 2px; font-size: 10px; letter-spacing: 0.16em; color: #9a7c3c; font-weight: 800; }
.modal h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 20px; color: #2c2412; letter-spacing: 0.02em; }
.modal h3 .hanja { font-size: 12px; color: #8a7448; margin-left: 4px; }
.modal-p { font-size: 13px; line-height: 1.55; color: #4a3d20; margin: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; flex: 0 0 auto; padding-top: 8px; border-top: 1px solid rgba(184, 134, 47, 0.22); }
.modal-actions .btn { flex: 1 1 88px; padding: 11px 8px; font-size: 13.5px; }
/* v5.32 — 요격 출진 편성 요약 */
.is-sum { display: flex; gap: 6px; margin: 0 0 7px; }
.is-sum span { flex: 1; text-align: center; padding: 5px 3px; border-radius: 8px; border: 1px solid #dcc9a0; background: #fffaf0; font-size: 9px; color: #7c6636; }
.is-sum b { display: block; font-size: 11.5px; color: #3a2c10; margin-top: 1px; }
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: #c3a568; border-radius: 4px; }

.intro-modal { display: flex; flex-direction: column; align-items: center; text-align: center; }
.intro-portrait { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; border: 2px solid #b8862f; margin-bottom: 6px; }
.intro-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.intro-modal p { font-family: var(--serif); font-size: 15px; color: #4a3a1a; margin: 4px 0 8px; }
.intro-modal ul { text-align: left; margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.6; color: #55452a; }
.intro-modal li { margin-bottom: 3px; }

.hero-info { display: flex; gap: 11px; }
.hi-portrait { width: 96px; height: 116px; border-radius: 10px; overflow: hidden; border: 1.5px solid #b8862f; flex: 0 0 auto; }
.hi-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.hi-body { flex: 1; min-width: 0; }
.hi-cls { margin: 0 0 4px; font-size: 11px; color: #8a7448; font-weight: 700; }
.hi-bars { display: flex; flex-wrap: wrap; gap: 4px; font-size: 10px; color: #4c5a38; }
.hi-bars span { background: #f3e6c8; border: 1px solid #d3bb8a; border-radius: 6px; padding: 2px 6px; }
.hi-attrs { display: flex; gap: 6px; margin: 7px 0 5px; }
.hi-attrs div { flex: 1; background: rgba(255, 252, 242, 0.7); border: 1px solid #d9c396; border-radius: 7px; padding: 3px 0; text-align: center; }
.hi-attrs span { display: block; font-size: 8.5px; color: #8a7448; }
.hi-attrs b { font-family: var(--serif); font-size: 14px; color: #3a2c10; }
.hi-desc { margin: 4px 0; font-size: 10.5px; line-height: 1.45; color: #5c4a28; }
.hi-quote { margin: 4px 0 0; font-family: var(--serif); font-size: 11px; color: #8a5f2a; }

.target-list { display: flex; flex-direction: column; gap: 7px; }
/* v5.32 — 장수 목록이 길어도 모달 하단 버튼(취소·보내기)이 화면에 남게 목록만 스크롤 */
.pick-scroll { max-height: 42vh; overflow-y: auto; padding-right: 2px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.target-card {
  display: flex; align-items: center; gap: 9px; border: 1px solid #cfb47d; border-radius: 11px;
  background: rgba(255, 251, 240, 0.8); padding: 8px 10px; text-align: left;
}
.target-card:active { background: #fff6e2; }
/* v5.29 — 수송 목적지: 육로/해로/멀리 표시 */
.target-card .tp-via { font-style: normal; font-size: 8px; font-weight: 800; color: #6b7a5a;
  border: 1px solid #c3cfa8; border-radius: 7px; padding: 0 4px; margin-left: 3px; }
.tc-flag { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff6e0; font-family: var(--serif); font-weight: 900; font-size: 14px; }
.tc-main { flex: 1; min-width: 0; }
.tc-main b { display: block; font-family: var(--serif); font-size: 14px; color: #2e2510; }
.tc-main b em { font-size: 10px; color: #8a7448; margin-left: 3px; }
.tc-main span { font-size: 9.5px; color: #7b6538; }
.tc-troops { text-align: right; }
.tc-troops .tc-state { font-family: inherit; font-size: 9.5px; font-weight: 800; color: #6c7b4a; }
.tc-troops .tc-state.done { color: #9a8f76; }
/* v5.35 — 시설 담당·부장 고르기 머리글 */
.duty-pick-head { margin: 10px 0 4px; font-size: 11.5px; font-weight: 800; color: #5a4a26; }
.duty-pick-head em { font-style: normal; font-weight: 600; font-size: 10px; color: #8a7448; margin-left: 4px; }
.tc-troops span { display: block; font-size: 8.5px; color: #8a7448; }
.tc-troops b { font-family: var(--serif); font-size: 14px; color: #3a2c10; }
/* v5.56 — 징병 미리보기의 훈련도 변화 */
.tc-troops .tc-train-down { display: block; font-style: normal; font-size: 8.5px; font-weight: 800; color: #c0562a; }
.tc-troops .tc-train-down.flat { color: #7c9a52; }
/* v5.56 — 고유 특기 등급 배지 */
.gi-trait-tier { font-style: normal; font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 7px; margin-left: 4px; background: #efe0bd; color: #6b5324; }
.gi-trait-tier.tier-S { background: linear-gradient(180deg,#e8453a,#b8201a); color: #fff6e0; }
.gi-trait-tier.tier-A { background: linear-gradient(180deg,#9b62c8,#7742a3); color: #fff6e0; }
.gi-trait-tier.tier-B { background: linear-gradient(180deg,#3d7ddb,#2559ab); color: #fff6e0; }
.gi-trait-tier.tier-C { background: linear-gradient(180deg,#4f9c66,#33764a); color: #fff6e0; }
.gi-trait-note { margin: 3px 0 0; font-size: 9.5px; color: #6b5324; }
.tc-go { color: #b8862f; font-size: 16px; }
/* v5.27 — 외교 화면: 상태 배지·관련도순 묶음 */
.dp-grp { display: flex; align-items: baseline; gap: 6px; margin: 9px 1px 1px; }
.dp-grp:first-child { margin-top: 2px; }
.dp-grp span { font-family: var(--serif); font-weight: 900; font-size: 12.5px; color: #3a2d15; }
.dp-grp em { font-style: normal; font-size: 10px; color: #fff6e0; background: #8a6a34; border-radius: 8px; padding: 1px 6px; }
.dp-grp i { font-style: normal; font-size: 9px; color: #8a7448; margin-left: auto; }
.dp-card { padding: 7px 9px; }
.dp-badge { flex: none; font-size: 9px; font-weight: 800; border-radius: 7px; padding: 2px 6px; border: 1px solid transparent; white-space: nowrap; }
.dp-war { color: #8e2a1c; background: #fbe6df; border-color: #e2ac9d; }
.dp-truce { color: #8a5a10; background: #fdf0d4; border-color: #e3c68d; }
.dp-pact { color: #1f5a46; background: #e2f2ea; border-color: #a9d3c2; }
.dp-more { width: 100%; margin-top: 5px; padding: 7px 0; border: 1px dashed #cfb47d; border-radius: 9px;
  background: rgba(255, 251, 240, 0.7); color: #6b5528; font-size: 10.5px; font-weight: 700; }
.dp-more:active { background: #fff6e2; }

.deploy-wrap { display: flex; flex-direction: column; gap: 8px; }
.deploy-banner { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 14%, #fff8e6), #fdf7ea);
  border: 1px solid color-mix(in srgb, var(--fc) 45%, #d9c396); }
.db-flag { width: 30px; height: 30px; border-radius: 7px; background: var(--fc); color: #fff6e0; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; }
.deploy-banner b { display: block; font-size: 13px; color: #33280f; }
.deploy-banner span { font-size: 9.5px; color: #7b6538; }
/* v5.65 — 전장 적 총병력은 한 줄 안에서 강조 */
.deploy-banner span b.df-total { display: inline; font-family: var(--serif); font-size: 11.5px; color: #a8443a; }
.troop-ledger { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.troop-ledger div { background: rgba(255, 251, 240, 0.75); border: 1px solid #d9c396; border-radius: 8px; padding: 5px 2px; text-align: center; }
.troop-ledger span { display: block; font-size: 8px; color: #8a7448; }
.troop-ledger b { font-family: var(--serif); font-size: 13px; color: #33280f; }
.troop-ledger b.hot { color: #a8443a; }
.troop-ledger b.bad { color: #c22d1c; }
.deploy-tip { margin: 0; font-size: 10px; line-height: 1.45; color: #6b5830; }
.deploy-section { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.deploy-section span { font-family: var(--serif); font-weight: 900; font-size: 13px; color: #3a2d15; }
.deploy-section em { font-size: 8.5px; color: #94804f; }
.deploy-list { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.hero-pick { display: flex; align-items: center; gap: 7px; border: 1px solid #d3bb8a; border-radius: 9px; background: rgba(255, 252, 244, 0.7); padding: 5px 7px; text-align: left; }
.hero-pick.on { border-color: #47673c; background: #f2f7e6; box-shadow: inset 0 0 0 1px #47673c; }
.hero-pick img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
.hp-main { flex: 1; min-width: 0; }
.hp-main b { display: block; font-size: 12px; color: #2e2510; }
.hp-main span { font-size: 9px; color: #7b6538; }
.hp-stats { display: flex; gap: 4px; font-size: 8.5px; color: #6b5830; }
.hp-troops { font-size: 9px; color: #8a5f2a; font-weight: 800; white-space: nowrap; }
.hp-check { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #b99a5e; color: transparent; font-size: 10px; display: grid; place-items: center; }
.hero-pick.on .hp-check { background: #47673c; color: #fff; border-color: #47673c; }
.regiment-list { display: flex; flex-direction: column; gap: 4px; max-height: 176px; overflow-y: auto; }
.reg-row { display: flex; align-items: center; gap: 7px; border: 1px solid #dcc9a0; border-radius: 8px; background: rgba(255, 252, 244, 0.55); padding: 4px 7px; }
.reg-row.on { border-color: #b8862f; background: #fdf3dc; }
.reg-emblem { width: 26px; height: 26px; border-radius: 6px; background: #efe0bd; border: 1px solid #c3a568; display: grid; place-items: center; font-family: var(--serif); font-size: 11px; color: #5c4a24; }
.reg-main { flex: 1; min-width: 0; }
.reg-main b { display: block; font-size: 11px; color: #33280f; }
.reg-main span { font-size: 8.5px; color: #7b6538; }
.reg-stepper { display: flex; align-items: center; gap: 6px; }
.reg-stepper button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #b99a5e; background: #fff8e6; color: #6b4d18; font-size: 13px; font-weight: 900; }
.reg-count { min-width: 14px; text-align: center; font-size: 12px; color: #33280f; }
.deploy-count { margin: 2px 0 0; font-size: 10px; color: #6b5830; text-align: right; }
.deploy-count b { color: #a8443a; }

.month-report { display: flex; flex-direction: column; gap: 6px; }
.mr-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; background: rgba(255, 251, 240, 0.7); border: 1px solid #dcc9a0; border-radius: 8px; font-size: 12px; color: #4a3d20; }
.mr-row b { font-family: var(--serif); font-size: 14px; color: #33280f; }
.mr-row b.plus { color: #3f7a3c; }
.mr-note { font-size: 10px; color: #8a7448; margin: 4px 0 0; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-list button { padding: 11px 12px; border-radius: 9px; border: 1px solid #cfb47d; background: rgba(255, 252, 244, 0.8); text-align: left; font-size: 13px; color: #3a2d15; font-weight: 700; }
.menu-list button:active { background: #fff6e2; }
.help-body { display: flex; flex-direction: column; gap: 8px; }
.help-item b { font-family: var(--serif); font-size: 13px; color: #3a2d15; }
.help-item p { margin: 2px 0 0; font-size: 11px; line-height: 1.5; color: #5c4a28; }

.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill-row { display: flex; align-items: center; gap: 8px; border: 1px solid #cfb47d; border-radius: 9px; background: rgba(255, 252, 244, 0.8); padding: 7px 9px; text-align: left; }
.skill-row.off { opacity: 0.42; }
/* v5.62 — 아직 레벨이 모자란 책략: 미리 보여 주되 흐리게 + 잠금 배지 (누를 수 없다) */
.skill-row.lock { opacity: 0.55; filter: grayscale(0.55); border-style: dashed; background: rgba(244, 238, 224, 0.75); }
.skill-row.lock .sk-mp { background: #e6e0d1; border-color: #b9ad91; color: #7b6f57; }
.skill-row b .sk-lock { font-style: normal; font-size: 8.5px; font-weight: 900; color: #6b5a3a; background: rgba(96, 80, 48, 0.12); border: 1px dashed #a8997a; border-radius: 6px; padding: 0 5px; margin-left: 5px; vertical-align: middle; }
.skill-locknote { margin: 4px 0 0; font-size: 9px; color: #7a6a4a; text-align: right; }
.skill-locknote em { font-style: normal; color: #9a8558; }
.sk-mp { width: 28px; height: 28px; border-radius: 50%; background: #dbe9f5; border: 1px solid #8fb4d6; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #33587c; }
.skill-row b { display: block; font-size: 12.5px; color: #2e2510; }
.skill-row b em { font-size: 9px; color: #8a7448; margin-left: 3px; }
/* v5.33 — 책사·풍수사·도사 책략 사거리 +1 표기 */
.skill-row b .sk-rng { font-style: normal; font-size: 8.5px; font-weight: 800; color: #a4601e; background: rgba(214, 168, 70, 0.18); border-radius: 6px; padding: 0 5px; margin-left: 5px; vertical-align: middle; }
.skill-row span { font-size: 9.5px; color: #6b5830; }
.skill-mp { font-size: 10px; color: #5c6f8a; text-align: right; margin: 6px 0 0; }

.battle-info { display: flex; gap: 10px; }
.battle-info img { width: 74px; height: 88px; border-radius: 8px; object-fit: cover; object-position: 50% 16%; border: 1px solid #b8862f; }
.bi-main { flex: 1; }
.bi-cls { margin: 0 0 4px; font-size: 11px; color: #8a7448; }
.bi-hp { position: relative; height: 14px; background: #d6c19a; border-radius: 5px; overflow: hidden; }
.bi-hp i { display: block; height: 100%; background: linear-gradient(90deg, #6fbf6a, #479144); }
.bi-hp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #1c2612; }
.bi-attrs { display: flex; gap: 5px; margin: 5px 0; font-size: 9.5px; color: #5c4a28; }
.bi-attrs span { background: #f3e6c8; border: 1px solid #d3bb8a; border-radius: 5px; padding: 2px 5px; }
.bi-terr { margin: 0; font-size: 9.5px; color: #4e6a3c; }

.result-modal { text-align: center; }
.rm-seal { width: 62px; height: 62px; margin: 0 auto 8px; border-radius: 12px; display: grid; place-items: center; font-family: var(--serif); font-size: 34px; font-weight: 900; color: #fff3d8; background: #a8443a; border: 2px solid #e8cf94; box-shadow: 0 6px 16px rgba(120, 30, 20, 0.35); }
.result-modal.lose .rm-seal { background: #4a4a4a; }
.rm-line { font-size: 13px; line-height: 1.5; color: #3a2f1a; margin: 0 0 10px; }
.rm-fall { margin: -4px 0 10px; font-size: 11px; font-weight: 800; color: #8e2a1c; background: #fbe6df; border: 1px solid #e2ac9d; border-radius: 8px; padding: 5px 8px; }
.rm-release { margin: -6px 0 10px; font-size: 11px; font-weight: 800; color: #2f6b45; background: #e6f4ea; border: 1px solid #b7d9c4; border-radius: 8px; padding: 5px 8px; }
.rm-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rm-rewards div { background: rgba(255, 251, 240, 0.74); border: 1px solid #dcc9a0; border-radius: 8px; padding: 6px; }
.rm-rewards span { display: block; font-size: 9px; color: #8a7448; }
.rm-rewards b { font-family: var(--serif); font-size: 15px; color: #7a4a12; }
.rm-survivors { display: flex; justify-content: center; gap: 4px; margin: 10px 0 6px; flex-wrap: wrap; }
.rm-survivors img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; object-position: 50% 18%; border: 1px solid #b8862f; }
.rm-note { font-size: 10px; color: #8a7448; margin: 4px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 150px; transform: translate(-50%, 10px); z-index: 90;
  background: rgba(38, 30, 14, 0.94); color: #f8eccb; border: 1px solid rgba(227, 189, 99, 0.55);
  border-radius: 20px; padding: 8px 16px; font-size: 12px; max-width: 84vw; text-align: center;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 가로/큰 화면 보정 */
@media (min-width: 720px) {
  #screen-title::before {
    content: ''; position: absolute; inset: -6%;
    background: url("../assets/title_bg.webp") center / cover no-repeat;
    filter: blur(28px) brightness(0.5) saturate(1.15);
  }
  .title-art { inset: 0; }
  .title-art img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
  .title-floor { height: 10%; }
  .title-logo { font-size: 52px; }
  .title-logo span { font-size: 36px; }
  .title-kicker { font-size: 13px; }
  .title-sub { font-size: 14px; }
  .modal { max-width: 460px; }
  .modal.wide { max-width: 560px; }
  .map-hint { font-size: 12px; }
  .city-commands { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 720px; margin: 0 auto; width: 100%; }
}
@media (max-height: 700px) {
  .city-general-strip { min-height: 52px; padding: 5px 8px; }
  .gen-chip img { width: 28px; height: 28px; }
  .city-mid > .city-scene { min-height: 132px; }
  .city-mid > .city-dev { padding: 3px 10px 4px; }
  .city-mid > .city-general-strip { min-height: 46px; padding: 4px 8px; }
  .city-mid > .city-ap { padding: 3px 10px 4px; }
  .title-inner { padding-top: calc(24px + env(safe-area-inset-top)); }
  .title-logo { font-size: 33px; }
  .title-logo span { font-size: 24px; }
  .title-sub { margin-top: 8px; font-size: 11.5px; }
  .battle-bottom { padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); }
  .unit-card { min-height: 52px; }
  .uc-portrait { width: 46px; height: 46px; }
}

.hi-exp { position: relative; height: 10px; border-radius: 5px; background: #ddcba4; overflow: hidden; margin: 4px 0 1px; }
.hi-exp i { display: block; height: 100%; background: linear-gradient(90deg, #b8862f, #e3bd63); }
.hi-exp em { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7.5px; font-weight: 800; color: #3a2c10; }
.hi-next { margin: 0 0 3px; font-size: 8.5px; color: #8a5f2a; }
/* v5.32 — 훈련 결과 상단 병사 훈련도 배너 (50 → 59 +9) */
.train-banner { margin: 0 0 8px; padding: 8px 9px; border-radius: 10px; border: 1.5px solid #c69a4c;
  background: linear-gradient(120deg, #fff6dc, #f4e2b4); box-shadow: inset 0 0 0 1px rgba(255,250,235,.7); }
.tb-top { display: flex; align-items: baseline; gap: 6px; }
.tb-top > span { font-size: 9.5px; font-weight: 900; color: #7a4a12; letter-spacing: .01em; }
.tb-top > b { font-family: var(--serif); font-size: 17px; color: #3f2c0a; }
.tb-top > b em { font-style: normal; font-size: 12px; color: #a07a34; margin: 0 1px; }
.tb-gain { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 900; color: #1f6b3a;
  background: #dff1d8; border: 1px solid #9dc98d; border-radius: 8px; padding: 1px 7px; }
.tb-bar { position: relative; display: block; height: 9px; margin: 6px 0 4px; border-radius: 5px; background: #e0cda4; overflow: hidden; }
.tb-bar s { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #b8862f, #ffd86b); }
.tb-bar u { position: absolute; top: -1px; bottom: -1px; width: 2px; background: #5a4212; opacity: .75; }
.tb-note { margin: 0; font-size: 9px; line-height: 1.45; color: #7c6636; }
/* v5.32 — 탐색 모달: 한 명씩 / 여러 명 한번에 */
.ex-tabs { display: flex; gap: 4px; margin: 0 0 7px; padding: 3px; border-radius: 9px; background: #efe0bd; border: 1px solid #d9c396; }
.ex-tabs button { flex: 1; padding: 6px 4px; border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 900; color: #7c6636; }
.ex-tabs button.on { background: linear-gradient(180deg, #fff8e6, #f0dba6); border-color: #b8862f; color: #4a2f0c; box-shadow: 0 1px 3px rgba(120,80,24,.25); }
.ex-many-bar { display: flex; align-items: center; gap: 5px; margin: 0 0 7px; }
.ex-many-bar button { padding: 5px 8px; border-radius: 7px; border: 1px solid #c9a86c; background: #fffaf0; cursor: pointer;
  font-family: inherit; font-size: 9.5px; font-weight: 800; color: #6b5324; }
.ex-many-bar b { margin-left: auto; font-size: 10px; color: #8a5a1a; }
.ex-pick { position: relative; }
.ex-pick.on { border-color: #b8862f; background: #fff6de; box-shadow: inset 0 0 0 1px #e0c07a; }
.ex-check { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b49a68; background: #fffdf6;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: transparent; }
.ex-check.on { background: linear-gradient(180deg, #ffe08a, #d9a63f); border-color: #a97c22; color: #3a2a06; }
.ex-go { display: block; width: 100%; margin: 8px 0 0; padding: 10px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid #2f6fd0; background: linear-gradient(180deg, #5a97e8, #2f6fd0); color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 900; box-shadow: 0 2px 6px rgba(30,60,120,.3); }
.ex-go:disabled { cursor: default; opacity: .45; box-shadow: none; }
.exr-list { display: flex; flex-direction: column; gap: 5px; max-height: 52vh; overflow-y: auto; }
.exr-row { display: flex; align-items: baseline; gap: 7px; padding: 6px 8px; border-radius: 9px; border: 1px solid #dcc9a0; background: #fffaf0; }
.exr-row.fail { opacity: .72; border-style: dashed; }
.exr-row > b { flex: 0 0 58px; font-size: 11px; color: #3a2c10; }
.exr-row > div { flex: 1; min-width: 0; }
.exr-row span { display: block; font-size: 10px; font-weight: 800; color: #6b5324; }
.exr-row em { display: block; font-style: normal; font-size: 9px; color: #8a7448; margin-top: 1px; }
.train-list { display: flex; flex-direction: column; gap: 6px; }
.train-row { display: flex; align-items: center; gap: 2px 7px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid #dcc9a0; border-radius: 9px; background: rgba(255, 251, 240, .72); }
.train-row.up { border-color: #b8862f; background: #fdf3dc; }
.train-row img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
.tr-main { flex: 1; min-width: 90px; }
.tr-main b { display: block; font-size: 12px; color: #2e2510; }
.tr-main span { font-size: 9px; color: #7b6538; }
.tr-exp { position: relative; flex: 1 0 100%; height: 7px; border-radius: 4px; background: #ddcba4; overflow: hidden; }
.tr-exp i { display: block; height: 100%; background: linear-gradient(90deg, #b8862f, #e3bd63); }
.tr-exp em { position: absolute; inset: -2px 0 auto; font-size: 6.5px; color: #4a3a18; text-align: right; }
.tr-up { font-size: 9px; font-weight: 800; color: #a8443a; background: #f7e2c2; border: 1px solid #d9a86a; border-radius: 6px; padding: 1px 6px; }
.tr-gain { flex: 1 0 100%; padding-left: 41px; font-size: 9.5px; color: #3f7a3c; font-weight: 700; line-height: 1.4; }

.rm-levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 8px 0 2px; }
.rm-levels span { font-size: 9.5px; font-weight: 700; color: #4a5a34; background: #f2f7e6; border: 1px solid #b7c49a; border-radius: 12px; padding: 2px 8px; }
.rm-levels span.promote { color: #8a2f22; background: #fbe9c9; border-color: #d9a86a; animation: promoGlow 1.8s ease-in-out infinite; }
@keyframes promoGlow { 50% { box-shadow: 0 0 10px rgba(216, 168, 90, .8); } }

/* ── 499 장수 UI ── */
.talent-note { margin: 0 0 8px; font-size: 10px; color: #7b6538; line-height: 1.45; }
.gen-pick-list { display: flex; flex-direction: column; gap: 5px; max-height: 44vh; overflow-y: auto; }
.gen-pick { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid #dcc9a0; border-radius: 9px; background: rgba(255, 251, 240, .76); text-align: left; }
.gen-pick.off { opacity: .45; }
.gen-pick:active { background: #fff6e2; }
.gen-pick img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
/* v5.24 — 장수 등급 4색 통일: S 빨강 · A 보라 · B 파랑 · C 초록 (밝은 흰 글씨) */
.tier { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-family: var(--serif); font-size: 10px; font-weight: 900; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .55); }
.tier.tS { background: linear-gradient(180deg, #e03c2d 0%, #bd2a1d 55%, #a81d13 100%); border-color: #ff9384; }
.tier.tA { background: linear-gradient(180deg, #9248cc 0%, #7a35b0 55%, #632599 100%); border-color: #d9b3f7; }
.tier.tB { background: linear-gradient(180deg, #3274d9 0%, #2558b5 55%, #1c4d9e 100%); border-color: #a9c9ff; }
.tier.tC { background: linear-gradient(180deg, #32945c 0%, #26774a 55%, #1e663d 100%); border-color: #a3e3bf; }
.gp-main { flex: 1; min-width: 0; }
.gp-main b { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #2e2510; }
.gp-main span { display: block; font-size: 9px; color: #7b6538; }
.gp-main em { display: block; font-size: 8.5px; color: #8a7448; font-style: normal; }
.gp-main .gp-stats { display: flex; flex-wrap: wrap; gap: 2px 7px; margin-top: 1px; }
.gp-main .gp-stats i { font-style: normal; font-size: 8.5px; color: #6b5830; }
.gp-main .gp-stats i b { display: inline; font-size: 9.5px; color: #33280f; }
/* v5.65 — 주점 등용 카드: 합류 레벨 안내 */
.gp-main .gp-join { display: inline-block; margin-top: 2px; font-style: normal; font-size: 8.5px; font-weight: 800; color: #6a4a12; background: #f6e6bf; border: 1px solid #dcc28a; border-radius: 999px; padding: 0 6px; }
.gp-cost { font-size: 9.5px; font-weight: 800; color: #8a5f2a; white-space: nowrap; }
.bi-skill { margin: 0 0 3px; font-size: 9px; color: #8a2f22; font-weight: 700; }
.hire-card { display: flex; gap: 10px; align-items: center; }
.hire-card img { width: 72px; height: 86px; border-radius: 8px; object-fit: cover; object-position: 50% 18%; border: 1px solid #b8862f; }
.hire-card p { margin: 2px 0; font-size: 11px; color: #4a3d20; }
.hire-card .hc-skill { color: #8a2f22; font-weight: 700; }
.hire-card .hc-stat { font-size: 9.5px; color: #6b5830; }

.enemy-gens { margin: -2px 0 2px; font-size: 9.5px; color: #8a2f22; font-weight: 700; }

.hi-equip { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0; }
.eq-chip { font-size: 8px; font-weight: 700; color: var(--gc, #6b5830); border: 1px solid var(--gc, #c3a568); border-radius: 10px; padding: 1px 6px; background: #fffaf0; }
.eq-none { font-size: 8.5px; color: #9a8a66; }
.hi-bonus { margin: 0 0 3px; font-size: 8.5px; color: #3f7a5a; }
.tr-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tr-slot { border: 1px solid #d3bb8a; border-radius: 9px; background: rgba(255, 251, 240, .8); padding: 6px 8px; text-align: left; }
.tr-slot.sel { border-color: #b8862f; background: #fdf3dc; box-shadow: inset 0 0 0 1px #b8862f; }
.ts-type { display: block; font-size: 8.5px; color: #8a7448; }
.tr-slot b { font-size: 11px; }
.tr-inv-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 5px; font-size: 10px; color: #7b6538; font-weight: 800; }
.tr-unequip { padding: 3px 9px !important; font-size: 9px !important; flex: 0 0 auto !important; }
.tr-list { display: flex; flex-direction: column; gap: 4px; max-height: 34vh; overflow-y: auto; }
.tr-item { display: flex; align-items: center; gap: 7px; border: 1px solid #dcc9a0; border-left: 3px solid var(--gc, #b8862f); border-radius: 8px; background: rgba(255, 251, 240, .76); padding: 5px 8px; text-align: left; }
.tr-grade { font-size: 8px; font-weight: 800; color: var(--gc, #b8862f); }
.tr-item div { flex: 1; min-width: 0; }
.tr-item b { display: block; font-size: 11.5px; color: #2e2510; }
.tr-item span { display: block; font-size: 8.5px; color: #7b6538; }
.tr-item em { font-size: 9px; font-weight: 800; color: #3f7a5a; font-style: normal; }
.tr-empty { font-size: 10px; color: #8a7448; line-height: 1.5; }
.tr-note { font-size: 8.5px; color: #9a8a66; margin: 6px 0 0; }
.rm-treasure { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 8px 0 2px; padding: 7px; border: 1px dashed var(--gc, #b8862f); border-radius: 10px; background: #fff9ea; }
.rt-grade { font-size: 8.5px; font-weight: 800; color: var(--gc, #b8862f); }
.rm-treasure b { font-family: var(--serif); font-size: 15px; color: var(--gc, #7a4a12); }
.rm-treasure em { font-size: 9px; color: #6b5830; font-style: normal; }

.event-card { width: 100%; display: flex; gap: 10px; background: linear-gradient(160deg, #fdf3dc, #f0ddb6); border: 1px solid #b8862f; border-radius: 14px; padding: 12px; box-shadow: 0 14px 30px rgba(20, 14, 4, .5); animation: introIn .3s ease; }
.ev-seal { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 900; color: #fff3d8; background: #a8443a; border: 2px solid #e8cf94; }
.ev-main { flex: 1; min-width: 0; }
.ev-type { display: inline-block; font-size: 8.5px; font-weight: 800; color: #fff6e0; background: #7a5a2a; border-radius: 10px; padding: 1px 8px; }
.ev-main h4 { margin: 3px 0 2px; font-family: var(--serif); font-size: 16px; color: #2c2412; }
.ev-dialogue { margin: 2px 0 4px; font-size: 12px; line-height: 1.5; color: #4a3a1a; }
.ev-reward { margin: 0; font-size: 9.5px; color: #8a5f2a; }
.ev-enemy { display: block; margin-top: 4px; font-style: normal; font-size: 9px; font-weight: 800; color: #9a3412; }
.event-card .ic-tap { display: block; text-align: right; font-size: 9px; color: #8a7448; margin-top: 4px; animation: blink 1.4s infinite; }
.rm-event { margin: 4px 0 0; font-size: 10px; color: #8a2f22; font-weight: 700; }

.sc-list { display: flex; flex-direction: column; gap: 7px; max-height: 56vh; overflow-y: auto; }
.sc-card { display: flex; gap: 9px; text-align: left; border: 1px solid #cfb47d; border-radius: 11px; background: rgba(255, 251, 240, .8); padding: 9px 10px; }
.sc-card:active { background: #fff6e2; }
.sc-year { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 9px; background: #3a2f1a; color: #f2dfb4; font-family: var(--serif); font-weight: 900; font-size: 13px; display: grid; place-items: center; }
.sc-main { flex: 1; min-width: 0; }
.sc-main b { display: block; font-family: var(--serif); font-size: 14px; color: #2e2510; }
.sc-main p { margin: 2px 0 3px; font-size: 10px; line-height: 1.45; color: #6b5830; }
.sc-line { font-size: 8.5px; color: #8a5f2a; }
.sc-summary { font-size: 11px; color: #5c4a28; }

/* ═══════════ v3 · 내정 행동력 · 컷인 · 파티클 ═══════════ */
.js-sound .snd-glyph { display: block; line-height: 1; font-size: 15px; }
.js-sound.muted { opacity: 0.55; }
.js-sound.muted .snd-glyph { text-decoration: line-through; text-decoration-thickness: 2px; }
.city-top .js-sound { background: #f3e4c2; color: #5b4a27; border-color: #c3a568; }
.battle-top .js-sound { background: rgba(58, 47, 26, 0.9); }

.city-ap { background: #f7ecd6; border-top: 1px solid rgba(184, 134, 47, 0.35); padding: 5px 10px 6px; }
.ap-head { display: flex; align-items: center; gap: 6px; }
.ap-title { font-size: 8px; letter-spacing: 0.06em; color: #8a7448; font-weight: 800; }
.ap-count { font-family: var(--serif); font-size: 12px; color: #3f6b32; white-space: nowrap; }
.ap-count.none { color: #a8443a; }
.ap-actor { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #6b5830; font-weight: 700; white-space: nowrap; }
.ap-actor img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid #b8862f; }
.ap-dots { display: flex; gap: 3px; margin-top: 4px; }
.ap-dots i { flex: 1; height: 5px; border-radius: 2px; background: linear-gradient(90deg, #4e8b3c, #79b85a); }
.ap-dots i.spent { background: #ddcdae; }
.city-commands .cmd.off { opacity: 0.38; }
.city-commands.locked .cmd.off:active { background: none; }

.gen-chip { position: relative; border: 1px solid #cfb47d; text-align: left; }
.gen-chip .gc-flag { font-size: 7.5px; font-weight: 800; color: #3f7a3c; background: #eef6e2; border: 1px solid #b7c49a; border-radius: 9px; padding: 1px 5px; margin-left: 2px; white-space: nowrap; }
.gen-chip.done { opacity: 0.55; filter: grayscale(0.55); }
.gen-chip.done .gc-flag { color: #8a7448; background: #efe6d2; border-color: #d3bb8a; }
.gen-chip.sel { border-color: #3f6fb5; background: #f3f8ff; box-shadow: 0 0 0 2px rgba(63, 111, 181, 0.22), 0 2px 6px rgba(90, 70, 30, 0.16); }
.gen-chip.sel .gc-flag { color: #2c4f86; background: #e3edfb; border-color: #9bb8e0; }

.city-floats { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.hot-float { position: absolute; transform: translate(-50%, -50%); animation: hotFloat 1.45s ease-out forwards; }
.hot-float b { display: inline-block; font-family: var(--serif); font-size: 15px; font-weight: 900; color: #fff4cd; letter-spacing: -0.01em;
  text-shadow: 0 2px 0 #7a4a12, 0 0 12px rgba(255, 220, 120, 0.9); white-space: nowrap; }
@keyframes hotFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.72); }
  22% { opacity: 1; transform: translate(-50%, -62%) scale(1.12); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -195%) scale(1); }
}
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffe9a8;
  box-shadow: 0 0 8px 2px rgba(255, 214, 110, 0.85); animation: sparkFly 0.95s ease-out forwards; }
@keyframes sparkFly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx) * 52px), calc(-50% + var(--dy) * 52px)) scale(0.15); }
}
.hotspot.bump i { animation: hopBump 0.55s ease; }
@keyframes hopBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.8); box-shadow: 0 0 0 11px rgba(255, 240, 190, 0.32), 0 2px 6px rgba(0, 0, 0, 0.4); }
  100% { transform: scale(1); }
}

.city-cutin { position: absolute; left: 8px; right: 84px; bottom: 10px; z-index: 6; display: flex; gap: 9px; align-items: center; text-align: left;
  padding: 8px 10px 8px 8px; border-radius: 12px; border: 1px solid rgba(227, 189, 99, 0.85);
  background: linear-gradient(100deg, rgba(38, 30, 15, 0.95), rgba(58, 45, 22, 0.88));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); opacity: 0; transform: translateX(-16%) scale(0.95);
  transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); pointer-events: none; }
.city-cutin.show { opacity: 1; transform: none; }
.city-cutin::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, #ffe6ac, #b8862f); }
.ci-portrait { width: 50px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid #e3bd63; flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); background: #2b2313; }
.ci-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
.ci-body { min-width: 0; }
.ci-body b { display: block; font-family: var(--serif); font-size: 14px; color: #fff2cf; line-height: 1.2; }
.ci-body em { font-size: 8.5px; color: #c9b183; }
.ci-body p { margin: 2px 0 0; font-size: 11.5px; color: #f6e8c9; line-height: 1.35; }
.city-cutin.show .ci-portrait { animation: ciPop 0.5s ease both; }
@keyframes ciPop { from { transform: translateY(6px) scale(0.88); opacity: 0.35; } }

.tr-lead { font-size: 7.5px; color: #a8443a; font-style: normal; background: #f7e2c2; border: 1px solid #d9a86a; border-radius: 8px; padding: 0 4px; }

.mr-event { display: flex; gap: 8px; align-items: center; padding: 8px 9px; border-radius: 10px;
  border: 1px solid #d9a86a; background: linear-gradient(100deg, #fdf1d6, #f6e0b6); }
.mr-event .me-seal { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  font-family: var(--serif); font-size: 14px; font-weight: 900; color: #fff6e0; background: #a8443a; border: 1px solid #e8cf94; }
.mr-event .me-main { flex: 1; min-width: 0; }
.mr-event b { display: block; font-size: 12px; color: #7a4a12; }
.mr-event span { display: block; font-size: 9.5px; color: #6b5830; line-height: 1.4; }
.mr-event em { font-size: 9px; font-weight: 800; color: #3f7a3c; font-style: normal; }

/* ═══════════ v3 · 인연 · 전장 피드 · 숙적 콜아웃 ═══════════ */
.hi-bonds { margin: 6px 0 4px; border-top: 1px dashed #d3bb8a; padding-top: 5px; }
.hb-title { margin: 0 0 4px; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: #8a7448; }
.hb-row { display: flex; gap: 5px; align-items: flex-start; padding: 3px 5px; border-radius: 7px; margin-bottom: 3px; border: 1px solid #dcc9a0; background: rgba(255, 251, 240, 0.6); }
.hb-row.friend { border-color: #b7c49a; background: #f4f9ea; }
.hb-row.rival { border-color: #e0b09a; background: #fdf0e8; }
.hb-rel { flex: 0 0 auto; font-size: 7.5px; font-weight: 800; border-radius: 8px; padding: 1px 5px; color: #fff8e8; background: #6d8a4e; }
.hb-row.rival .hb-rel { background: #a8443a; }
.hb-row b { display: block; font-size: 10.5px; color: #2e2510; }
.hb-row span { display: block; font-size: 8.5px; color: #8a5f2a; }
.hb-row em { display: block; font-size: 8px; color: #6b5830; font-style: normal; line-height: 1.35; }
.gen-pick.refuse { border-style: dashed; border-color: #d08e78; background: #fdf2ec; }
.gen-pick.refuse .gp-cost { color: #a8443a; }
.gen-pick.refuse .tier { filter: grayscale(0.7); }

/* v5.12 — 상단 중앙 '성문 1/3' 알약과 겹치지 않게 피드 띠를 HUD 아래로 내리고 폭을 좁혔다.
   (3중 성벽에서도 인연·숙적 알림이 성문 알약을 가리지 않는다) */
.battle-feed { position: absolute; left: 8px; top: 74px; z-index: 3; display: flex; flex-direction: column; gap: 3px; max-width: min(58%, 214px); pointer-events: none; }
.feed-pill { font-size: 9px; line-height: 1.3; color: #f4e6c6; background: rgba(36, 29, 16, 0.82);
  border: 1px solid rgba(227, 189, 99, 0.35); border-left: 2px solid #e3bd63; border-radius: 6px; padding: 3px 7px;
  word-break: keep-all; overflow-wrap: anywhere;
  opacity: 0; transform: translateX(-8px); transition: opacity 0.2s, transform 0.2s; }
.feed-pill.in { opacity: 1; transform: none; }
.feed-pill.rival { border-left-color: #d0503c; color: #ffd9cd; }
.feed-pill.friend { border-left-color: #8fc46a; color: #e6f4d4; }
/* v5.14 — 수성전에서 적이 성문을 때릴 때 */
.feed-pill.bad { border-left-color: #c0392b; color: #ffd8cf; background: rgba(52, 20, 16, 0.84); }

.battle-callout { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -6px) scale(0.94); z-index: 4;
  padding: 6px 16px; border-radius: 24px; font-family: var(--serif); font-weight: 900; font-size: 15px; letter-spacing: 0.02em;
  color: #fff3d6; background: linear-gradient(90deg, rgba(120, 30, 22, 0.92), rgba(60, 20, 14, 0.92));
  border: 1px solid #e8b47a; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.24s; }
.battle-callout.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.battle-callout.duel { background: linear-gradient(90deg, rgba(96, 46, 12, 0.94), rgba(48, 22, 6, 0.94)); border-color: #ffd58a; }

/* ═══ v5.30 — 조조전식 일기토 컷인 ═══
   양쪽 장수 초상이 좌우에서 미끄러져 들어오고 가운데에 「일기토」가 찍힌다.
   --dcs는 배속(paceMs)에 맞춰 배틀 JS가 줄인다 — ×4에서도 200ms 안쪽. */
.duel-cutin { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 14%; gap: 3%; }
.duel-cutin[hidden] { display: none; }
.duel-cutin::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 34%, rgba(28, 16, 6, 0.30), rgba(16, 8, 2, 0.62));
  opacity: 0; transition: opacity calc(0.18s * var(--dcs, 1)) ease-out; }
.duel-cutin::after { content: ''; position: absolute; left: 50%; top: 10%; width: 2px; height: 30%;
  background: linear-gradient(180deg, transparent, #ffe6a8 34%, #ffb27a 66%, transparent);
  transform: translateX(-50%) rotate(11deg); opacity: 0; transition: opacity calc(0.2s * var(--dcs, 1)); }
.duel-cutin.show::before { opacity: 1; }
.duel-cutin.show::after { opacity: 0.6; }
.dc-side { position: relative; flex: 0 0 30%; max-width: 108px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform calc(0.26s * var(--dcs, 1)) cubic-bezier(0.16, 0.9, 0.3, 1), opacity calc(0.22s * var(--dcs, 1));
  opacity: 0; z-index: 1; }
.dc-side.a { transform: translateX(-118%) rotate(-3deg); }
.dc-side.b { transform: translateX(118%) rotate(3deg); }
.duel-cutin.show .dc-side.a, .duel-cutin.show .dc-side.b { transform: none; opacity: 1; }
.duel-cutin.out .dc-side.a { transform: translateX(-118%); opacity: 0; }
.duel-cutin.out .dc-side.b { transform: translateX(118%); opacity: 0; }
.dc-card { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 10px 10px 5px 5px; border: 2px solid rgba(240, 205, 140, 0.85); background: #f0dcb4;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.65), inset 0 0 20px rgba(120, 80, 30, 0.28); }
.dc-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; display: block; filter: saturate(0.94) contrast(1.03); }
.dc-card::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(158deg, rgba(246, 226, 184, 0.78), rgba(208, 170, 108, 0.62) 58%, rgba(96, 62, 26, 0.55));
  mix-blend-mode: multiply; }
.dc-side b { font-family: var(--serif); font-size: 12px; font-weight: 900; color: #fff1cf; letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); background: rgba(24, 14, 4, 0.68); border-radius: 10px; padding: 1px 9px; }
.dc-side.b b { color: #ffd9cf; }
.dc-mid { position: relative; flex: 0 0 22%; align-self: flex-start; margin-top: 4px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  opacity: 0; transform: scale(0.7); transition: opacity calc(0.16s * var(--dcs, 1)) ease-out, transform calc(0.2s * var(--dcs, 1)) cubic-bezier(0.2, 1.5, 0.4, 1); z-index: 1; }
.duel-cutin.show .dc-mid { opacity: 1; transform: scale(1); }
.dc-mid span { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 3px #000); }
.dc-mid b { font-family: var(--serif); font-size: 14px; font-weight: 900; color: #ffe6a8; letter-spacing: 0.06em;
  background: rgba(24, 14, 4, 0.72); border: 1px solid rgba(232, 180, 122, 0.5); border-radius: 10px; padding: 1px 9px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95); }
.dc-mid em { font-style: normal; font-size: 8px; font-weight: 800; color: #f0d8a8; max-width: 100%; text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-cutin.rival .dc-mid b { color: #ffb9a2; }
/* 일기토 중에는 목표 알약·미니맵을 잠시 가려 전장을 비운다 */
.battle-stage.dueling .battle-objective, .battle-stage.dueling .battle-minimap { opacity: 0; transition: opacity 0.14s; }
.battle-stage.dueling .battle-minimap { pointer-events: none; }

/* 크리티컬 한 방 — 화면 가장자리가 금빛으로 번쩍인다 */
.crit-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 244, 200, 0) 38%, rgba(255, 226, 150, 0.42) 78%, rgba(255, 196, 96, 0.62) 100%);
  box-shadow: inset 0 0 26px rgba(255, 226, 160, 0.8); }
.crit-flash.on { animation: critPulse 220ms ease-out; }
@keyframes critPulse { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }

.mr-event.crisis { border-color: #d08e78; background: linear-gradient(100deg, #fbe9e0, #f3d3c2); }
.mr-event.crisis .me-seal { background: #8f3226; }
.me-season { font-size: 7.5px; font-weight: 700; color: #9a7c3c; font-style: normal; margin-left: 3px; }
.mr-event.crisis .me-season { color: #a8443a; }

/* ═══════════ v3 · 관작 · 대사 ═══════════ */
.rank-chip { font-family: var(--serif); font-size: 10px; font-weight: 900; color: #7a4a12;
  background: linear-gradient(180deg, #ffeec4, #e7c987); border: 1px solid #b8862f; border-radius: 10px;
  padding: 0 7px; letter-spacing: 0.02em; }
.rank-chip.sm { font-size: 8.5px; padding: 0 6px; align-self: center; }
.date-ribbon .rank-chip { color: #6b3f10; }
.deploy-quote { margin: 0; font-family: var(--serif); font-size: 10.5px; line-height: 1.45; color: #7a4a12;
  background: #fdf3dc; border-left: 2px solid #b8862f; border-radius: 4px; padding: 4px 8px;
  word-break: keep-all; overflow-wrap: anywhere; }   /* v5.28 — '조조'가 '조/조'로 쪼개지지 않게 */
.rm-quote { margin: 8px 0 0; font-family: var(--serif); font-size: 11.5px; line-height: 1.5; color: #7a4a12; word-break: keep-all; overflow-wrap: anywhere; }

/* ═══════════ v3 · 조조전식 전투 예고 · 계절 ═══════════ */
.season-chip { font-family: var(--serif); font-size: 10px; font-weight: 900; color: #2f4728;
  background: #eaf3dd; border: 1px solid #9db97c; border-radius: 50%; width: 17px; height: 17px;
  display: inline-grid; place-items: center; line-height: 1; }
.date-ribbon .season-chip { color: #2f4728; }
.atk-preview { display: flex; flex-direction: column; gap: 5px; }
.ap-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  background: rgba(255, 251, 240, 0.78); border: 1px solid #dcc9a0; font-size: 11px; color: #4a3d20; }
.ap-row span { flex: 0 0 62px; font-size: 10px; color: #8a7448; font-weight: 700; }
.ap-row b { font-family: var(--serif); font-size: 16px; color: #a8443a; margin-left: auto; }
.ap-row em { font-size: 8.5px; color: #8a7448; font-style: normal; min-width: 56px; text-align: right; }
.ap-row.counter b { color: #7a5a2a; }
.ap-bond { padding: 6px 9px; border-radius: 8px; font-size: 10.5px; font-weight: 800; border: 1px solid #b7c49a; background: #f2f7e6; color: #3f6b32; }
.ap-bond.rival { border-color: #e0b09a; background: #fdf0e8; color: #a8443a; }
.ap-bond em { font-style: normal; font-size: 9px; margin-left: 4px; }
.ap-note { margin: 2px 0 0; font-size: 9.5px; color: #8a7448; text-align: right; }

/* ═══════════ v3 · 부드러운 터치 스크롤 ═══════════ */
.city-general-strip, .sheet-gens { touch-action: pan-x; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.deploy-list, .regiment-list, .gen-pick-list, .tr-list, .modal, .sc-list, .train-list, .skill-list {
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
}
.modal, .gen-pick-list, .tr-list, .deploy-list, .regiment-list, .sc-list { scrollbar-width: thin; }
.world-viewport, .battle-stage { touch-action: none; }

.toast.top { top: auto; bottom: calc(58px + env(safe-area-inset-bottom)); }

/* v5.35 — 창 본문 스크롤바 (굴릴 수 있다는 걸 보이게) */
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: #c3a568; border-radius: 4px; }

/* ═══════════ v4 · 세력 선택 · 위임 · 연표 ═══════════ */
.fac-list { display: flex; flex-direction: column; gap: 6px; max-height: 54vh; overflow-y: auto; }
.fac-card {
  display: flex; align-items: center; gap: 9px; text-align: left; padding: 8px 10px;
  border: 1px solid #cfb47d; border-left: 4px solid var(--fc, #b8862f); border-radius: 11px;
  background: linear-gradient(100deg, rgba(255, 251, 240, 0.92), rgba(250, 242, 222, 0.82));
}
.fac-card:active { background: #fff6e2; }
.fc-seal {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--fc, #8b8677); color: #fff8e6; font-family: var(--serif); font-weight: 900; font-size: 16px;
  border: 1px solid rgba(255, 246, 224, 0.7); box-shadow: 0 2px 5px rgba(60, 44, 16, 0.28);
}
.fc-main { flex: 1; min-width: 0; }
.fc-main b { display: block; font-family: var(--serif); font-size: 14px; color: #2e2510; }
.fc-main span { display: block; font-size: 9.5px; color: #7b6538; }
.fc-main em { display: block; font-size: 8.5px; color: #8a7448; font-style: normal; }
.fc-go { color: #b8862f; font-size: 15px; }

.ap-row2 { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.ap-row2 .ap-dots { flex: 1; margin-top: 0; }
.ap-delegate {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1px solid #9a7c3c; border-radius: 8px; padding: 3px 8px 3px 5px;
  background: linear-gradient(180deg, #fdf3dc, #ecd9ae); color: #5a4415; font-size: 9.5px; font-weight: 800;
  box-shadow: 0 1px 3px rgba(90, 70, 30, 0.2);
}
.ap-delegate span {
  font-family: var(--serif); font-size: 8px; background: #7a4a12; color: #ffeec4;
  border-radius: 4px; padding: 1px 4px; letter-spacing: 0.02em;
}
.ap-delegate.off { opacity: 0.4; }
.ap-delegate:active { filter: brightness(0.96); }

.office-wrap { display: flex; flex-direction: column; gap: 8px; }
.office-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.office-stats div { background: rgba(255, 251, 240, 0.8); border: 1px solid #d9c396; border-radius: 8px; padding: 5px 2px; text-align: center; }
.office-stats span { display: block; font-size: 8px; color: #8a7448; }
.office-stats b { font-family: var(--serif); font-size: 14px; color: #33280f; }
.office-note { margin: 0; font-size: 10px; color: #6b5830; line-height: 1.45; }
.office-officers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.office-officer { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 7px 9px;
  border: 1px solid #b7c49a; border-radius: 10px; background: linear-gradient(160deg, #f6faee, #e9f1da); }
.office-officer span { font-size: 8px; font-weight: 800; letter-spacing: 0.08em; color: #47673c; }
.office-officer b { font-family: var(--serif); font-size: 14px; color: #2f4728; }
.office-officer em { font-style: normal; font-size: 8.5px; line-height: 1.35; color: #5c6b46; }
.office-officer:disabled { opacity: 0.45; }
.office-auto { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 7px 9px;
  border: 1px dashed #c3a568; border-radius: 10px; background: rgba(255, 251, 240, 0.6); }
.office-auto.on { border-style: solid; border-color: #8fae7a; background: #f2f7e6; }
.office-auto.info { border-style: solid; border-color: #cbb27f; background: rgba(255, 250, 236, 0.85); }
.office-auto b { font-size: 12px; color: #3a2d15; }
.office-auto span { font-size: 9px; color: #6b5830; line-height: 1.4; }
.mr-auto { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 9px;
  border: 1px solid #b7c49a; background: linear-gradient(100deg, #f5f9ec, #eaf2da); }
.mr-auto-title { margin: 0 0 1px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; color: #47673c; }
.mr-auto-row { display: flex; gap: 6px; align-items: baseline; font-size: 10px; color: #4a3d20; }
.mr-auto-row b { flex: 0 0 auto; font-size: 10px; color: #2f4728; }
.mr-auto-row span { flex: 1; min-width: 0; font-size: 9.5px; color: #5c6b46; }
/* v5.50 — 월정산 '위임 거점 보고': 태수가 앉은 성마다 이번 달에 한 일 */
.mr-gov { gap: 4px; border-color: #9fbb84; background: linear-gradient(100deg, #f7fbef, #e7f1d4); }
.mr-gov .mr-auto-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.mr-gov .mr-auto-title em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: 0; color: #6f8557; }
.mgc { padding: 5px 7px; border-radius: 8px; border: 1px solid #d2dfba; background: rgba(255, 253, 246, 0.85); }
.mgc.idle { border-style: dashed; border-color: #ddd2b8; background: rgba(253, 250, 241, 0.7); }
.mgc-head { display: flex; align-items: baseline; gap: 5px; }
.mgc-head b { font-family: var(--serif); font-size: 11.5px; font-weight: 800; color: #2f4728; }
.mgc-head span { font-size: 9.5px; color: #5c6b46; }
.mgc-pol { margin-left: auto; flex: 0 0 auto; font-style: normal; font-size: 8.5px; font-weight: 800; color: #7b6538;
  padding: 1px 5px; border-radius: 6px; background: #f5ecd4; border: 1px solid #ddc9a0; }
.mgc-acts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.mgc-chip { display: inline-flex; align-items: baseline; gap: 3px; font-size: 9px; line-height: 1.3; color: #4a3d20;
  padding: 2px 5px; border-radius: 6px; background: #eef4e0; border: 1px solid #cfdcb4; }
.mgc-chip i { font-style: normal; font-weight: 800; color: #3f6b34; }
.mgc-chip.rest { background: transparent; border-style: dashed; border-color: #ddd2b8; color: #8a7448; }
.mgc-more { margin-top: 1px; }
.mgc-more summary { font-size: 9px; font-weight: 700; color: #6b5830; cursor: pointer; padding: 2px 1px; list-style: none; }
.mgc-more summary::-webkit-details-marker { display: none; }
.mgc-more summary::before { content: '▸ '; }
/* ── v5.66 수도 자동 내정 표식 · 일괄 항복 권유 ── */
.mgc-cap { flex: 0 0 auto; font-style: normal; font-size: 8px; font-weight: 900; letter-spacing: 0.02em; color: #7c4a12;
  padding: 0 4px; border-radius: 999px; border: 1px solid #d0a24a; background: #fdf1cc; }
.surrender-offer { display: flex; flex-direction: column; gap: 6px; }
.so-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.so-row { display: flex; align-items: baseline; gap: 6px; padding: 5px 8px; border-radius: 7px;
  background: #f8efd9; border: 1px solid #e0cda0; font-size: 11px; }
.so-row b { flex: 0 0 auto; font-family: var(--serif); font-size: 12px; color: #2e2510; }
.so-row span { flex: 1; min-width: 0; font-size: 10px; color: #6b5324; }
.so-row em { flex: 0 0 auto; font-style: normal; font-size: 10.5px; font-weight: 800; color: #8a3a22; font-variant-numeric: tabular-nums; }
.so-note { margin: 2px 0 0; font-size: 10px; line-height: 1.55; color: #7b6538; }
.mgc-more[open] summary::before { content: '▾ '; }
.mgc-more[open] { display: flex; flex-direction: column; gap: 4px; }
.menu-list button:disabled { opacity: 0.45; }
.menu-list button.primary { border-color: #47673c; background: #f2f7e6; color: #2f4728; box-shadow: inset 0 0 0 1px #8fae7a; }

.gp-rumor { color: #8a5f2a !important; font-style: italic; }
.tc-portrait { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }

.timeline-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.tl-seal {
  width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; font-weight: 900; color: #fff3d8;
  background: #7a4a12; border: 2px solid #e8cf94;
}
.timeline-card p { margin: 0; font-size: 12.5px; line-height: 1.6; color: #3a2f1a; }
.timeline-card .tl-date { font-size: 10px; color: #8a7448; font-family: var(--serif); }


/* ═══════════ v4 · 성 등급 장면 연출 ═══════════ */
.city-scene { transition: filter 0.4s ease; }
.city-scene.lv-1 > img { filter: saturate(0.82) brightness(0.94); }
.city-scene.lv-2 > img { filter: saturate(0.94) brightness(0.99); }
.city-scene.lv-3 > img { filter: saturate(1.04) brightness(1.03); }
.city-scene.lv-4 > img { filter: saturate(1.12) brightness(1.06) contrast(1.03); }
.city-scene.lv-5 > img { filter: saturate(1.2) brightness(1.08) contrast(1.05); }
.city-scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 46%, rgba(255, 214, 130, 0.42), rgba(255, 190, 90, 0) 62%);
  transition: opacity 0.5s ease; mix-blend-mode: soft-light;
}
.city-scene.lv-3::after { opacity: 0.5; }
.city-scene.lv-4::after { opacity: 0.75; }
.city-scene.lv-5::after { opacity: 1; }
.scene-lv { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sb-flag {
  position: absolute; top: 30%; width: 13px; height: 18px; border-radius: 1px;
  background: linear-gradient(180deg, #b8443a, #8a2f22);
  border-left: 3px solid #4a2b12; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  animation: sbWave 3.2s ease-in-out infinite alternate; transform-origin: 50% 0;
  opacity: 0.92;
}
@keyframes sbWave { from { transform: skewX(-3deg) scaleY(1); } to { transform: skewX(4deg) scaleY(0.97); } }
.sb-lamp {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #ffdc8a; box-shadow: 0 0 8px 3px rgba(255, 206, 110, 0.55);
  animation: sbGlow 2.4s ease-in-out infinite alternate;
}
@keyframes sbGlow { from { opacity: 0.55; } to { opacity: 1; } }
.sb-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 232, 160, 0.3), rgba(255, 210, 120, 0) 60%);
  animation: sbPulse 4.5s ease-in-out infinite alternate;
}
@keyframes sbPulse { from { opacity: 0.45; } to { opacity: 0.9; } }

/* ═══════════ v4 · 장수 명부 ═══════════ */
.roster { display: flex; flex-direction: column; gap: 7px; }
.rs-tabs { display: flex; gap: 5px; }
.rs-tabs button {
  flex: 1; padding: 7px 0; border-radius: 8px; font-size: 12px; font-weight: 800;
  border: 1px solid #c4a870; background: linear-gradient(180deg, #f7ecd4, #e6d2a8); color: #5a4415;
}
.rs-tabs button.on { background: linear-gradient(180deg, #7a5a2a, #5c431c); color: #ffeec4; border-color: #e3bd63; }
.rs-body { min-height: 220px; }
.rs-table { border: 1px solid #cfb47d; border-radius: 9px; overflow: hidden; background: rgba(255, 252, 244, 0.7); }
.rs-head, .rs-row {
  display: grid; grid-template-columns: 1.95fr 0.6fr repeat(6, 0.47fr) 0.72fr 0.86fr;
  align-items: center; gap: 0; width: 100%;
}
.rs-head { background: linear-gradient(180deg, #4a2f14, #3a2410); }
.rs-th {
  border: 0; background: none; color: #f0dcae; font-size: 8.5px; font-weight: 800;
  padding: 6px 1px; text-align: center; letter-spacing: -0.02em;
  white-space: nowrap;            /* v5.28 — 정렬 화살표가 아래 줄로 떨어져 머리글이 깨지지 않게 */
}
.rs-arrow { font-size: 6px; font-style: normal; margin-left: 1px; vertical-align: 1px; opacity: 0.95; }
.rs-th:first-child { text-align: left; padding-left: 6px; }
.rs-th.on { color: #ffe9a8; }
.rs-rows { max-height: 46vh; overflow-y: auto; }
.rs-row { border: 0; border-top: 1px solid rgba(190, 165, 115, 0.5); background: rgba(255, 252, 244, 0.72); padding: 3px 0; text-align: center; }
.rs-row:active { background: #fff6e2; }
.rs-name { display: flex; align-items: center; gap: 3px; padding-left: 3px; text-align: left; min-width: 0; }
.rs-name img { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; flex: 0 0 auto; }
.rs-name b { font-size: 10.5px; color: #2e2510; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.rs-name .rs-age { flex: 0 0 auto; }
.rs-num { font-family: var(--serif); font-size: 10.5px; color: #3a2c10; }
.rs-num.dim { color: #6b5830; }
/* v5.64 — 레벨 칸: `Lv.12` 배지 + 다음 해금(Lv.10/20/30)까지의 진행 막대 */
.rs-lv {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  justify-self: center; min-width: 0;
}
.rs-lv b {
  font-family: var(--serif); font-size: 8.5px; font-weight: 900; line-height: 1.1; letter-spacing: -0.03em;
  color: #6b4a12; background: linear-gradient(180deg, #fbf2da, #efdbb2);
  border: 1px solid #d9bf88; border-radius: 5px; padding: 0 2px; white-space: nowrap;
}
.rs-lv .rs-lv-bar {
  display: block; width: 100%; max-width: 24px; height: 2px; border-radius: 2px;
  background: rgba(150, 120, 60, 0.28); overflow: hidden;
}
.rs-lv .rs-lv-bar em { display: block; height: 100%; background: #b8862f; border-radius: 2px; }
.rs-lv.near b { color: #7a3a0c; border-color: #c98a3a; background: linear-gradient(180deg, #ffe9c0, #f3cf92); }
.rs-lv.near .rs-lv-bar em { background: #d97a2a; }
.rs-lv.now b { color: #5c3a00; border-color: #e3bd63; background: linear-gradient(180deg, #ffe9a8, #f0c96a); box-shadow: 0 0 0 1px rgba(227, 189, 99, 0.45); }
.rs-lv.now .rs-lv-bar em { background: #e0a52a; }
.rs-lv.max b { color: #fff4d6; border-color: #b8862f; background: linear-gradient(180deg, #9a6d1e, #7a5416); }
.rs-lv.max .rs-lv-bar em { background: #b8862f; }
.rs-role { font-size: 8px; font-weight: 800; color: #fff6e0; background: #8a7448; border-radius: 5px; padding: 1px 3px; justify-self: center; }
.rs-role.r-군주 { background: #a8443a; }
.rs-role.r-군사 { background: #3f6b8a; }
.rs-role.r-태수 { background: #47673c; }
.rs-city { font-size: 9px; color: #5c4a28; }
.rs-note { margin: 5px 0 0; font-size: 8.5px; color: #9a8a66; text-align: right; line-height: 1.45; }
.rs-note b { color: #8a5f2a; }
.rs-empty { font-size: 11px; color: #8a7448; padding: 18px 8px; text-align: center; }

.rs-inv { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border: 1px dashed #cfb47d; border-radius: 9px; background: #fff9ea; margin-bottom: 6px; }
.rs-inv b { font-size: 10.5px; color: #5a4415; }
.rs-inv span { display: flex; flex-wrap: wrap; gap: 4px; font-size: 8.5px; color: #8a7448; }
.rs-inv i { font-style: normal; font-weight: 700; color: var(--gc, #6b5830); border: 1px solid var(--gc, #c3a568); border-radius: 10px; padding: 1px 6px; background: #fffaf0; }
/* v5.50 — '보관 중인 보물' 칩을 누르면 상세 창 */
.rs-inv b em { font-style: normal; font-size: 8.5px; font-weight: 600; color: #8a7448; margin-left: 4px; }
.rs-inv-chip { font-family: inherit; font-size: 9.5px; font-weight: 700; line-height: 1.35; color: var(--gc, #6b5830);
  border: 1px solid var(--gc, #c3a568); border-radius: 11px; padding: 3px 8px; min-height: 22px; background: #fffaf0; cursor: pointer; }
.rs-inv-chip:active { background: #f6e8c8; transform: scale(0.97); }
.tr-det { display: flex; flex-direction: column; gap: 7px; }
.tr-det-top { display: flex; align-items: baseline; gap: 6px; }
.tr-gd { font-size: 9px; font-weight: 900; letter-spacing: 0.04em; color: #fffaf0; background: var(--gc, #8a6a2a);
  border-radius: 7px; padding: 2px 7px; }
.tr-det-top b { font-family: var(--serif); font-size: 13px; color: #3a2d15; }
.tr-det-top em { font-style: normal; margin-left: auto; font-size: 9px; font-weight: 800; color: #7b6538;
  background: #f5ecd4; border: 1px solid #ddc9a0; border-radius: 7px; padding: 1px 6px; }
.tr-det-stat { margin: 0; padding: 7px 9px; border-radius: 8px; background: #f2f7e6; border: 1px solid #cfdcb4;
  font-family: var(--serif); font-size: 13px; font-weight: 800; color: #2f4728; }
.tr-det-stat.none { font-family: var(--sans); font-size: 10px; font-weight: 600; color: #7b6538; background: #faf6ea; border-color: #e0d4b6; }
.tr-det-effect { margin: 0; font-size: 11px; line-height: 1.55; color: #4a3d20; }
.tr-det-hint { margin: 0; font-size: 9px; line-height: 1.5; color: #8a7448; }
.rs-items { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow-y: auto; }
.rs-item { display: flex; align-items: center; gap: 7px; border: 1px solid #dcc9a0; border-radius: 9px; background: rgba(255, 252, 244, 0.76); padding: 5px 8px; text-align: left; }
.rs-item img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
.rs-item div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rs-item b { font-size: 11.5px; color: #2e2510; }
.rs-item span { display: flex; flex-wrap: wrap; gap: 3px; }
.rs-item em { font-size: 9px; color: #8a5f2a; font-style: normal; font-weight: 800; }
.rs-map { display: flex; flex-direction: column; gap: 5px; max-height: 48vh; overflow-y: auto; }
.rs-citycard { display: flex; align-items: center; gap: 8px; border: 1px solid #cfb47d; border-radius: 9px; background: rgba(255, 252, 244, 0.8); padding: 6px 9px; text-align: left; }
.rc-badge { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff8e6; font-size: 11px; font-weight: 800; border: 1px solid rgba(255, 246, 224, 0.7); flex: 0 0 auto; }
.rc-main { flex: 1; min-width: 0; }
.rc-main b { display: block; font-family: var(--serif); font-size: 12.5px; color: #2e2510; }
.rc-main b em { font-size: 9px; color: #8a7448; }
.rc-main span { font-size: 8.5px; color: #7b6538; }
.rc-gens { font-size: 9.5px; font-weight: 800; color: #8a5f2a; }
.gen-chip.all { border-style: dashed; }
.gc-all { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 14px; color: #7a5a2a; background: #f1e2c0; border: 1px solid #c3a568; }

/* ═══════════ v4.1 · 주점 인접 성 표시 ═══════════ */
.gp-city {
  flex: 0 0 auto; padding: 1px 6px; border-radius: 8px; font-size: 8px; font-weight: 800;
  background: #efe3c6; color: #7a6338; border: 1px solid #cbb387; letter-spacing: -0.01em;
  line-height: 1.3;
}
.gp-city.here { background: #e4eed6; color: #45602f; border-color: #9cb681; }

/* ═══════════ v4.1 · 군사 조언 ═══════════ */
.advice-wrap { display: flex; flex-direction: column; gap: 7px; }
.advice-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.advice-stats > div {
  background: #f6ecd6; border: 1px solid #d8c197; border-radius: 8px; padding: 4px 2px; text-align: center;
}
.advice-stats span { display: block; font-size: 9px; color: #7b6538; }
.advice-stats b { font-size: 13px; color: #2f2612; font-variant-numeric: tabular-nums; }
.advice-sum { margin: 0; font-size: 9.5px; line-height: 1.5; color: #6b5830; }
.advice-list { display: flex; flex-direction: column; gap: 6px; }
.advice-row {
  border: 1px solid #d8c197; border-left-width: 4px; border-radius: 9px;
  background: #fbf4e2; padding: 6px 9px 7px;
}
.advice-row.urgent { border-left-color: #b8443a; background: #fbeee4; }
.advice-row.warn { border-left-color: #c98a2a; background: #fbf2df; }
.advice-row.info { border-left-color: #4f7a9c; background: #f1f3ee; }
.advice-row.good { border-left-color: #4d7a42; background: #f0f4e6; }
.advice-head { display: flex; align-items: baseline; gap: 6px; }
.advice-head b { font-family: var(--serif); font-size: 12.5px; color: #2c2412; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }   /* v5.28 — '맞먹습니다'가 단어 중간에서 끊기지 않게 */
.advice-tone {
  flex: 0 0 auto; font-size: 8.5px; font-weight: 800; padding: 1px 5px; border-radius: 7px;
  background: #e6d6b4; color: #6b5322;
}
.advice-row.urgent .advice-tone { background: #b8443a; color: #fff2ea; }
.advice-row.warn .advice-tone { background: #c98a2a; color: #fff8ea; }
.advice-row.info .advice-tone { background: #4f7a9c; color: #f1f7ff; }
.advice-row.good .advice-tone { background: #4d7a42; color: #f2f8e8; }
.advice-row p { margin: 3px 0 0; font-size: 10px; line-height: 1.55; color: #4a3c20; word-break: keep-all; overflow-wrap: anywhere; }
.advice-go { display: inline-block; margin-top: 4px; font-size: 9px; font-weight: 800; color: #7a5c22; }
.advice-go::before { content: "▸ "; }

/* ═══════════════ v5 — 내성 슬롯 · 5묶음 메뉴 · 계열 오라 · 기술/관작 ═══════════════ */
.city-slots { background: linear-gradient(180deg, #f7ecd4, #efe0bd); border-top: 1px solid rgba(184,134,47,0.42); padding: 4px 8px 6px; }
.slot-head { display: flex; align-items: baseline; gap: 6px; }
.slot-head b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.slot-head span { font-size: 9px; font-weight: 800; color: #8a6a26; }
.slot-head em { margin-left: auto; font-size: 8px; font-style: normal; color: #8a7448; }
.slot-grid { display: flex; gap: 5px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.slot-grid::-webkit-scrollbar { display: none; }
.slot-card {
  flex: 0 0 auto; width: 104px; border: 1px solid #cfb47d; border-radius: 9px; background: #fffaf0;
  display: flex; align-items: center; gap: 4px; padding: 4px; text-align: left; position: relative;
  box-shadow: 0 1px 3px rgba(90,70,30,0.12);
}
.slot-card .sc-ico { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.slot-card .sc-main { min-width: 0; display: flex; flex-direction: column; }
.slot-card .sc-main b { font-size: 10px; color: #3a2d15; letter-spacing: -0.03em; }
.slot-card .sc-stars { font-size: 7px; color: #d9a227; letter-spacing: -0.06em; }
.slot-card .sc-main em { font-size: 7.5px; font-style: normal; color: #7a6338; display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-card .sc-face { width: 13px; height: 13px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid #b8862f; }
.slot-card .sc-lv { position: absolute; top: 3px; right: 4px; font-size: 7px; font-weight: 800; color: #8a6a26; }
.slot-card.empty { border-style: dashed; background: rgba(255,250,240,0.55); flex-direction: column; justify-content: center; align-items: center; gap: 0; width: 74px; }
.slot-card.empty .sc-empty { font-size: 15px; color: #b39a63; line-height: 1; }
.slot-card.empty b { font-size: 9px; color: #6f5b30; }
.slot-card.empty small { font-size: 7px; color: #9a8659; }
.slot-card:active { background: #f3e6c8; }

.city-groups { grid-template-columns: repeat(5, 1fr) !important; }
.city-groups .cmd-ic { font-size: 16px; color: #5b4a27; font-family: var(--serif); }
.city-next-btn {
  position: absolute; right: 10px; bottom: 74px; z-index: 8;
  border: 1.5px solid #5e2018; border-radius: 999px; padding: 8px 14px;
  background: linear-gradient(180deg, #b4553f, #8a3629); color: #fff3dc;
  font-family: var(--serif); font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(90,40,20,0.35);
}
.city-next-btn:active { transform: translateY(1px); }

/* 계열 오라 — 위 파랑 · 촉 옥빛 · 오 크림슨 · 한국 금 · 군웅 보라 */
.hi-portrait, .uc-portrait { box-shadow: 0 0 0 2px var(--fa, #b8862f), 0 0 12px -2px var(--fa, #b8862f); }
.rs-name img, .gen-pick img, .mini-gen img { box-shadow: 0 0 0 2px var(--fa, #b8862f); }
.sheet-stats.fogged b { color: #9a8a66; }
.fog { font-size: 8px; font-style: normal; color: #9a7444; }
.fog-note { font-size: 10px; line-height: 1.45; color: #7a6338; background: rgba(255,250,235,0.7); border: 1px dashed #cbb183; border-radius: 8px; padding: 6px 8px; margin: 2px 0 6px; }
.scout-on { color: #2f7a52; }
.sheet-actions em { font-style: normal; font-size: 9px; color: #8a7448; }

/* 묶음 메뉴 · 건설 목록 · 특기 */
.grp-list { display: flex; flex-direction: column; gap: 6px; }
.grp-row { display: flex; align-items: center; gap: 8px; border: 1px solid #cfb47d; background: #fffaf0; border-radius: 10px; padding: 9px 10px; text-align: left; }
.grp-row b { font-size: 12.5px; color: #33280f; display: block; }
.grp-row span { font-size: 10px; color: #7d6538; }
.grp-row .grp-go { margin-left: auto; color: #b8862f; }
.build-list { display: flex; flex-direction: column; gap: 5px; max-height: 52vh; overflow-y: auto; }
.build-row { display: flex; align-items: center; gap: 8px; border: 1px solid #d7c093; background: #fffaf0; border-radius: 9px; padding: 6px 8px; text-align: left; }
.build-row img { width: 34px; height: 34px; object-fit: contain; }
.build-row b { font-size: 12px; color: #33280f; }
.build-row b em { font-style: normal; font-size: 8px; color: #9a7b34; }
.build-row span { display: block; font-size: 9.5px; color: #7d6538; }
.build-row .br-cost { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 800; color: #8a5a12; }
.build-row[disabled] { opacity: 0.5; }
/* v5.65 — 건설 확인 창 */
.build-confirm { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.build-confirm .bc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 7px; background: #fffaf0; border: 1px solid #e0cfa6; }
.build-confirm .bc-row span { font-size: 10px; color: #7d6538; font-weight: 700; }
.build-confirm .bc-row b { font-size: 12px; color: #33280f; }
.build-confirm .bc-row b.bad { color: #a8443a; }
.build-confirm .bc-fx { margin: 2px 0 0; padding: 6px 8px; border-radius: 7px; background: #f6ecd4; border: 1px dashed #d2b782; font-size: 10.5px; line-height: 1.45; color: #5b4a27; }
.build-confirm .bc-fx b { display: block; font-size: 9px; color: #8a5a12; margin-bottom: 1px; }
.slot-detail { display: flex; gap: 10px; align-items: center; border: 1px solid #d7c093; background: #fffaf0; border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.slot-detail .sd-ico { width: 48px; height: 48px; object-fit: contain; }
.slot-detail b { display: block; font-size: 12px; color: #33280f; }
.slot-detail span { display: block; font-size: 10px; color: #6f5b30; }
.slot-detail em { font-style: normal; font-size: 9.5px; color: #a8443a; }

.hi-passive { border: 1px solid #d9c08d; background: linear-gradient(180deg, #fffaf0, #f6ecd6); border-radius: 9px; padding: 6px 8px; margin: 5px 0; }
.hi-passive span { font-size: 8px; letter-spacing: 0.08em; color: #9a7b34; font-weight: 800; }
.hi-passive > b { display: block; font-size: 12px; color: #7a3a12; font-family: var(--serif); }
.hi-passive p { margin: 2px 0 0; font-size: 10px; line-height: 1.45; color: #5b4a27; }
.gp-passive { display: inline-block; font-style: normal; font-size: 8.5px; color: #8a5a12; background: #fbf0d6; border: 1px solid #e0c58c; border-radius: 8px; padding: 0 5px; margin-top: 2px; }
/* v5.56 — 장수 상세 고유 특기: 등급 배지 + 실제 적용 수치 */
.hi-passive .gp-tier { font-style: normal; font-size: 8px; font-weight: 900; border-radius: 7px; padding: 0 5px; margin-left: 3px; color: #fff6e0; background: #8a6a34; }
.hi-passive .gp-tier.tS { background: linear-gradient(180deg,#e8453a,#b8201a); }
.hi-passive .gp-tier.tA { background: linear-gradient(180deg,#9b62c8,#7742a3); }
.hi-passive .gp-tier.tB { background: linear-gradient(180deg,#3d7ddb,#2559ab); }
.hi-passive .gp-tier.tC { background: linear-gradient(180deg,#4f9c66,#33764a); }
.hi-passive .hi-passive-applied { margin-top: 3px; font-size: 9.5px; font-weight: 800; color: #7a5a12; }
/* v5.82 — 장수 세부창 필살기 설명란 (고유 특기 박스와 같은 결, 금빛 대신 붉은 금테) */
.hi-ultimate { border: 1px solid #c9a06a; background: linear-gradient(180deg, #fff8ec, #f8e7cf); border-radius: 9px; padding: 6px 8px; margin: 5px 0; }
.hi-ultimate > span { font-size: 8px; letter-spacing: 0.08em; color: #a05a22; font-weight: 800; }
.hi-ultimate > b { display: block; font-size: 12px; color: #8a2a12; font-family: var(--serif); }
.hi-ultimate p { margin: 2px 0 0; font-size: 10px; line-height: 1.45; color: #5b3a27; }
.hi-ultimate .hu-line { margin-top: 3px; font-size: 9.5px; color: #8a5a3a; font-style: italic; }
.hi-ultimate .hu-tier { font-style: normal; font-size: 8px; font-weight: 900; border-radius: 7px; padding: 0 5px; margin-left: 3px; color: #fff6e0; background: #8a6a34; }
.hi-ultimate .hu-tier.tS { background: linear-gradient(180deg,#e8453a,#b8201a); }
.hi-ultimate .hu-tier.tA { background: linear-gradient(180deg,#9b62c8,#7742a3); }
.hi-ultimate .hu-once { font-style: normal; float: right; font-size: 8px; font-weight: 700; color: #9a7b34; }
.hi-ultimate.tA { border-color: #b79cd6; background: linear-gradient(180deg, #faf6ff, #f0e8fa); }
.hi-ultimate.tA > b { color: #5a3a86; }
.gc-age { font-style: normal; font-size: 8px; color: #8a7448; margin-left: 3px; font-weight: 700; }
.rs-age { font-style: normal; font-size: 8px; color: #8a7448; margin-left: 2px; font-weight: 700; }
.gen-chip.duty { border-color: #b98a2c; background: #fdf6e4; }
.gen-chip.duty .gc-flag { color: #8a5a12; background: #fbf0d6; border-color: #e0c58c; }
.ap-dots { align-items: center; gap: 5px; }
.ap-dots i { flex: 0 0 9px; height: 8px; border-radius: 2px; }
.ap-dots i.duty { background: linear-gradient(90deg,#c08a1f,#e8b84d); }
.ap-dots i.ready { background: linear-gradient(90deg,#4e8b3c,#79b85a); }
.ap-dots i.spent { background: #ddcdae; }
.ap-dots em { font-style: normal; font-size: 8px; color: #7d6538; margin-right: 6px; font-weight: 700; }

/* 기술 트리 */
.tech-wrap { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; }
.tech-branch { border: 1px solid #d7c093; border-radius: 10px; background: rgba(255,250,238,0.7); padding: 6px 7px; }
.tb-name { margin: 0 0 4px; font-family: var(--serif); font-size: 12px; color: #4a3a1a; }
.tech-node { display: flex; align-items: center; gap: 7px; width: 100%; border: 1px solid #dcc9a2; background: #fffaf0; border-radius: 8px; padding: 5px 7px; margin-bottom: 4px; text-align: left; }
.tech-node .tn-lv { font-family: var(--serif); font-size: 9px; color: #a3833d; width: 22px; }
.tech-node b { display: block; font-size: 11.5px; color: #33280f; }
.tech-node span { display: block; font-size: 9px; color: #7d6538; line-height: 1.3; }
.tech-node em { margin-left: auto; font-style: normal; font-size: 9.5px; font-weight: 800; color: #8a5a12; white-space: nowrap; }
.tech-node.ready { border-color: #9ac27a; box-shadow: 0 0 0 1px rgba(120,170,90,0.25) inset; }
.tech-node.done { background: #eef6e4; opacity: 0.9; }
.tech-node.done em { color: #3f7a3c; }
.tech-node.locked { opacity: 0.45; }
.tech-node[disabled] { opacity: 0.55; }

/* 관작 */
.rank-wrap { display: flex; flex-direction: column; gap: 6px; }
.rank-progress { height: 9px; border-radius: 5px; background: #e0cfa9; overflow: hidden; }
.rank-progress i { display: block; height: 100%; background: linear-gradient(90deg,#b8862f,#e8c268); }
.rank-note { font-size: 10px; color: #5b4a27; margin: 0; }
.rank-list { display: flex; flex-direction: column; gap: 3px; max-height: 44vh; overflow-y: auto; }
.rank-row { display: flex; align-items: center; gap: 6px; border: 1px solid #e0cfa9; border-radius: 8px; padding: 4px 7px; background: #fffaf0; font-size: 10px; }
.rank-row .rr-lv { width: 16px; font-family: var(--serif); color: #a3833d; font-size: 9px; }
.rank-row b { font-size: 11.5px; color: #33280f; min-width: 54px; }
.rank-row span { color: #7d6538; }
.rank-row em { margin-left: auto; font-style: normal; color: #8a7448; font-size: 8.5px; }
.rank-row.on { background: #fdf2da; border-color: #b8862f; box-shadow: inset 3px 0 0 #b8862f; }

/* 탐색 · 수송 */
.explore-card { border: 1px solid #d7c093; background: linear-gradient(180deg,#fffaf0,#f6ecd6); border-radius: 10px; padding: 10px; }
.explore-card p { margin: 0 0 6px; font-size: 11px; line-height: 1.55; color: #4a3a1a; }
.explore-card b { display: inline-block; font-size: 11px; color: #8a5a12; background: #fbf0d6; border: 1px solid #e0c58c; border-radius: 8px; padding: 2px 7px; }
.transport { display: flex; flex-direction: column; gap: 8px; }
.transport label { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #4a3a1a; font-weight: 700; }
.transport input[type=range] { flex: 1; accent-color: #b8862f; }
.transport b { min-width: 54px; text-align: right; font-family: var(--serif); color: #33280f; }
/* v5.59 — 수송품 직접 입력 (병력·금·군령) — 숫자 칸과 슬라이더가 한 줄에 쌍으로 */
.transport.tp2 { gap: 11px; }
.tp-row { display: flex; flex-direction: column; gap: 4px; }
.tp-head { display: flex; align-items: center; gap: 6px; }
.tp-name { font-size: 12px; font-weight: 800; color: #4a3a1a; letter-spacing: -0.02em; }
.tp-max { font-size: 10px; font-weight: 700; color: #8a5a12; background: #fbf0d6; border: 1px solid #e0c58c; border-radius: 6px; padding: 1px 6px; line-height: 1.5; }
.tp-max:active { background: #f2e0bc; }
.tp-box { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px;
  background: #fffdf7; border: 1px solid #cdb384; border-radius: 8px; box-shadow: inset 0 1px 2px rgba(90,70,30,.08); }
.tp-box:focus-within { border-color: #b8862f; box-shadow: 0 0 0 2px rgba(184,134,47,.18); }
.tp-num { width: 72px; min-width: 0; padding: 1px 0; border: 0; background: transparent; text-align: right;
  font-family: var(--serif); font-size: 15px; font-weight: 800; color: #33280f; line-height: 1.35; }
.tp-num:focus { outline: none; }
/* 기본 스피너(−1/＋1) 는 폰·PC 모두 감춘다 — 숫자 칸은 한 개로 통일 */
.tp-num::-webkit-outer-spin-button, .tp-num::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.tp-num { -moz-appearance: textfield; appearance: textfield; }
.tp-unit { font-size: 10px; font-style: normal; font-weight: 700; color: #8a7a55; min-width: 9px; }
.tp-range { width: 100%; margin: 0; accent-color: #b8862f; }
/* 성 화면 — 주둔병 가득 배지 */
.dev-note.dev-full { color: #8a5a12; font-weight: 800; background: #fbf0d6; border: 1px solid #e0c58c;
  border-radius: 7px; padding: 0 5px; font-size: 8.5px; white-space: nowrap; }
.city-groups { grid-template-columns: repeat(6, 1fr) !important; }
.city-groups .cmd.next .cmd-ic { background: linear-gradient(180deg, #b4553f, #8a3629); border-color: #5e2018; color: #fff3dc; font-size: 13px; }
.city-groups .cmd.next b { color: #8a2f22; }
.city-next-btn { display: none; }

/* 좁은 화면(390px 안팎) — 6칸 명령줄과 장수 상태판이 넘치지 않게 */
@media (max-width: 430px) {
  .city-groups { grid-template-columns: repeat(6, 1fr) !important; gap: 0; }
  .city-groups .cmd { padding: 2px 0; }
  .city-groups .cmd b { font-size: 9.5px; letter-spacing: -0.06em; }
  .city-groups .cmd small { display: none; }
  .city-groups .cmd-ic { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .slot-card { width: 92px; }
  .slot-card .sc-main b { font-size: 9.5px; }
  .slot-card .sc-lv { font-size: 6.5px; }
  .slot-head em { display: none; }
  .ap-row2 { flex-wrap: wrap; gap: 4px; }
  .ap-dots em { margin-right: 3px; }
  .slot-head b { font-size: 10px; }
  .dev-bars { grid-template-columns: 1fr 1fr; }
  .city-slots { padding: 3px 6px 5px; }
}

/* ══════════════════════════════════════════════════════════════
   v5.0.1 — 성 마당 건물 · 지도 버튼 · 월 전환 · 전장 편의
   ══════════════════════════════════════════════════════════════ */
/* 숙적 배지 — 빨간 바탕에 흰 글씨 (기존 .hb-row span 색에 먹히지 않게) */
.hi-bonds .hb-row span.hb-rel, .battle-info .hb-row span.hb-rel {
  color: #fff; background: #a8443a; text-shadow: 0 1px 1px rgba(60, 10, 6, 0.45);
}
.hi-bonds .hb-row.friend span.hb-rel { background: #4d6b34; color: #fff; }

/* 장수 상세 — 5대 능력치 */
.hi-attrs.five { gap: 4px; }
.hi-attrs.five div { padding: 3px 0; }
.hi-attrs.five b { font-size: 13px; }

/* 성 마당 — 지어진 건물·공터 */
.city-scene { min-height: 150px; }
.scene-hotspots { pointer-events: none; }
.scene-hotspots > * { pointer-events: auto; }
.yard-b {
  position: absolute; transform: translate(-50%, -50%);
  width: 56px; padding: 0; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(0 3px 4px rgba(30, 22, 8, 0.45));
}
.yard-b .yb-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 32%, rgba(255, 248, 226, 0.96), rgba(232, 208, 158, 0.92));
  border: 1.5px solid #a9873f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 2px 5px rgba(30, 22, 8, 0.35);
}
.yard-b .yb-ico img { width: 38px; height: 38px; object-fit: contain; }
.yard-b .yb-lv {
  position: absolute; top: -4px; right: -2px; min-width: 22px;
  font-size: 8px; font-weight: 900; color: #fff6e2;
  background: linear-gradient(180deg, #8a6220, #5e4315);
  border: 1px solid #e3bd63; border-radius: 7px; padding: 0 3px; line-height: 13px;
}
.yard-b .yb-face {
  position: absolute; left: -4px; bottom: 10px; width: 20px; height: 20px;
  border-radius: 50%; overflow: hidden; border: 1.5px solid #f2e2bc; background: #f6ead0;
}
.yard-b .yb-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.yard-b .yb-tag {
  margin-top: 1px; font-size: 9px; font-weight: 800; color: #fff8e4; white-space: nowrap;
  padding: 1px 6px; border-radius: 9px; background: rgba(40, 32, 16, 0.72);
  border: 1px solid rgba(227, 189, 99, 0.45);
}
.yard-b:active .yb-ico { transform: scale(0.94); }
.yard-b.bump .yb-ico { animation: hopBump 0.55s ease; }
.yard-b.empty .yb-ico {
  background: rgba(255, 248, 226, 0.42); border: 1.5px dashed rgba(120, 92, 40, 0.75);
  box-shadow: none;
}
.yard-b.empty .yb-plus { font-size: 22px; font-weight: 900; color: #6b4f1c; line-height: 1; }
.yard-b.empty .yb-tag { background: rgba(40, 32, 16, 0.55); }

/* 내성 시설 — 가로 줄 (마당 건물과 연동) */
.city-slots { padding: 3px 8px 5px; }
.slot-head { display: flex; align-items: baseline; gap: 6px; }
.slot-head b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.slot-head span { font-size: 8.5px; color: #7b6538; }
.slot-head em { margin-left: auto; font-size: 8px; color: #9a8a66; font-style: normal; }
.slot-row { display: flex; gap: 5px; overflow-x: auto; padding: 3px 0 1px; scrollbar-width: none; }
.slot-row::-webkit-scrollbar { display: none; }
.slot-card { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; border: 1px solid #d3bb8a; border-radius: 9px; background: rgba(255, 252, 244, 0.85); padding: 3px 7px 3px 3px; }
.slot-card .sc-ico { width: 26px; height: 26px; object-fit: contain; }
.slot-card .sc-main b { display: block; font-size: 10px; color: #33280f; line-height: 1.15; }
.slot-card .sc-main small { font-size: 8px; color: #8a7448; }
.slot-card .sc-main em { display: flex; align-items: center; gap: 2px; font-size: 7.5px; color: #7b6538; font-style: normal; }
.slot-card .sc-face { width: 12px; height: 12px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
.slot-card.empty { border-style: dashed; color: #8a7448; padding: 3px 8px; }
.slot-card.empty .sc-empty { font-size: 15px; font-weight: 900; color: #7d5a1d; }
.slot-card.empty b { font-size: 9.5px; }
.slot-card.empty small { display: block; font-size: 7.5px; }

/* 내정 화면 — 오른쪽 아래 지도 버튼 (엄지 접근) */
.btn-city-map {
  position: absolute; right: 9px; bottom: 9px;
  z-index: 8; display: flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 22px;
  border: 1px solid #e3bd63; color: #ffe6ac;
  background: linear-gradient(180deg, #4a3a1c, #2e2410);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 226, 160, 0.2);
  font-size: 12px; font-weight: 800; letter-spacing: -0.02em;
}
.btn-city-map::before {
  content: ""; width: 16px; height: 16px; background-repeat: no-repeat; background-position: center;
  background-size: 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffe6ac' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 6l5-2 6 2 5-2v14l-5 2-6-2-5 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E");
}
.btn-city-map:active { transform: translateY(1px); }

/* 월 전환 배너 */
.month-banner {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
}
.month-banner span {
  font-family: var(--serif); font-size: 30px; font-weight: 900; letter-spacing: 0.08em;
  color: #fff4d4; padding: 14px 26px; border-radius: 14px;
  background: rgba(32, 25, 12, 0.86);
  border: 1.5px solid #e3bd63;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 226, 160, 0.25);
  transform: scale(0.86);
}
.month-banner.show { opacity: 1; }
.month-banner.show span { animation: monthPop 1.5s ease; }
@keyframes monthPop {
  0% { transform: scale(0.8); letter-spacing: 0.3em; }
  22% { transform: scale(1.04); letter-spacing: 0.08em; }
  40% { transform: scale(1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 다음 달 확인 창 */
.next-month-confirm { text-align: center; padding: 4px 2px 2px; }
.nm-main { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: #2e2510; margin: 0 0 8px; }
.nm-main b { color: #a8443a; font-size: 17px; }
.nm-sub { font-size: 10px; line-height: 1.5; color: #7b6538; margin: 0; }

/* 출진 — 장수별 병력 조절 */
.hp-step { display: flex; align-items: center; gap: 3px; }
.hp-step button {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid #c3a568;
  background: #f6ebd2; color: #5c4a24; font-size: 14px; font-weight: 900; line-height: 1;
}
.hp-step .hp-count { min-width: 40px; text-align: center; font-size: 10px; color: #8a5f2a; font-weight: 800; }
.hero-pick { cursor: pointer; }

/* 보물 — 등급 색 + 능력치 + 효과 */
.tr-slot .ts-grade { display: inline-block; margin-top: 1px; font-size: 7.5px; font-weight: 800; color: var(--gc, #9a8a66); }
.tr-slot .ts-bonus { display: block; font-size: 8px; color: #6b5830; }
.tr-slot .ts-effect { display: block; font-size: 7.5px; color: #8a7448; line-height: 1.3; }
.tr-item .tr-bonus { display: block; font-size: 8px; color: #6b5830; }
.tr-item .tr-eff { display: block; font-size: 8px; color: #8a7448; }
/* v5.29 — 보물 문구의 전장 적용/미적용 표기 */
.tr-slot .ts-fx, .tr-item .tr-fx { display: block; margin-top: 2px; font-size: 7.5px; line-height: 1.35; color: #3f7a5a; }
.tr-slot .ts-fx b, .tr-item .tr-fx b { color: #2f6647; }
.tr-slot .ts-fx i, .tr-item .tr-fx i { font-style: normal; color: #a08a5a; }
.tr-slot .ts-fx .tr-dflt, .tr-item .tr-fx .tr-dflt { font-style: normal; color: #8a6a2a; font-weight: 700; }
/* v5.59 — 전장 적용 / 내정·외교 적용 두 줄 — 라벨 색을 달리해 한눈에 갈린다 */
.tr-slot .ts-fx .tp-fx-line, .tr-item .tr-fx .tp-fx-line { display: block; }
.tr-slot .ts-fx .tp-fx-line + .tp-fx-line, .tr-item .tr-fx .tp-fx-line + .tp-fx-line { margin-top: 1px; }
.tr-slot .ts-fx .tp-fx-line:first-child b, .tr-item .tr-fx .tp-fx-line:first-child b { color: #2f6647; }
.tr-slot .ts-fx .tp-fx-line:nth-child(2) b, .tr-item .tr-fx .tp-fx-line:nth-child(2) b { color: #8a6a2a; }
.tr-sum { margin: 6px 0 2px; padding: 5px 8px; border-radius: 7px; background: rgba(63, 122, 90, 0.10); border: 1px solid rgba(63, 122, 90, 0.35); }
.tr-sum span { display: block; font-size: 8px; color: #6b7a5a; }
.tr-sum b { display: block; font-size: 9.5px; color: #2f6647; line-height: 1.4; }
.tr-note.tr-fxnote { margin-top: 5px; line-height: 1.45; word-break: keep-all; }
.hi-bonus.hi-fx { color: #2f6647; line-height: 1.4; word-break: keep-all; }

/* 전장 — 사거리 안 대상 선택 줄 */
.battle-targets {
  display: flex; align-items: center; gap: 5px; overflow-x: auto;
  padding: 4px 8px 5px; background: rgba(24, 19, 9, 0.92);
  border-top: 1px solid rgba(227, 189, 99, 0.3);
}
.battle-targets[hidden] { display: none; }
.battle-targets .bt-hint { flex: 0 0 auto; font-size: 9px; font-weight: 800; color: #e6cf9a; }
.bt-chip {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 4px;
  padding: 4px 9px; border-radius: 14px; border: 1px solid #ff9d84;
  background: rgba(120, 36, 24, 0.55); color: #ffe9de; font-size: 10px;
}
.bt-chip.ally { border-color: #7fc59b; background: rgba(28, 88, 58, 0.55); color: #dcf6e6; }
.bt-chip b { font-size: 10.5px; }
.bt-chip em { font-size: 8.5px; font-style: normal; color: #f3d6c2; }
.bt-chip.ally em { color: #cbead8; }
.bt-chip:active { transform: translateY(1px); }
/* v5.13 — 풍수사 자가 치료: 대상 칩에 '나'가 붙은 자기 자신 */
.bt-chip.self { border-color: #ffe08a; background: rgba(96, 74, 20, 0.72); color: #fff4cf;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 150, 0.45); }
.bt-chip.self em { color: #ffe6a8; }

@media (max-width: 420px) {
  .yard-b { width: 50px; }
  .yard-b .yb-ico { width: 40px; height: 40px; border-radius: 11px; }
  .yard-b .yb-ico img { width: 33px; height: 33px; }
  .yard-b .yb-tag { font-size: 8px; padding: 0 5px; }
  .month-banner span { font-size: 25px; }
}

/* 큰 초상화 틀에서는 머리가 조금 더 차게 (작은 카드와 같은 구도를 유지하면서) */
.intro-portrait img, .hi-portrait img { transform: scale(1.18); transform-origin: 50% 22%; }

/* ═══════════ v5.2 — 시설 경험치 · 치안 · 관아 아이콘 · 병력 직접 입력 ═══════════ */
/* 관아(본성) — 동그라미 대신 궁궐 건물 그림 */
.hotspot.office .hs-ico {
  width: 46px; height: 46px; object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(20, 14, 4, 0.55));
  animation: hop 2.6s ease-in-out infinite;
}
@media (max-width: 420px) { .hotspot.office .hs-ico { width: 40px; height: 40px; } }

/* 내성 시설 카드 — 경험치 바 */
.slot-card .sc-main { padding-right: 2px; }
.slot-card .sc-exp {
  width: 100%; height: 4px; margin: 2px 0 1px; border-radius: 3px;
  background: rgba(150, 120, 70, 0.28); overflow: hidden;
}
.slot-card .sc-exp i { display: block; height: 100%; background: linear-gradient(90deg, #6f9a4a, #a8cf72); }
.slot-card .sc-exp.full i { background: linear-gradient(90deg, #d0a02a, #f2cf6a); }

/* 성 마당 건물 — 경험치 띠 */
.yard-b .yb-exp {
  width: 30px; height: 3px; margin-top: 1px; border-radius: 2px;
  background: rgba(30, 24, 10, 0.45); overflow: hidden;
}
.yard-b .yb-exp i { display: block; height: 100%; background: linear-gradient(90deg, #9fd070, #e8d06a); }

/* 시설 상세 — 경험 상자 */
.slot-expbox { margin: 7px 0 4px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 250, 238, 0.8); border: 1px solid #ddc79b; }
.slot-expbox .se-head { display: flex; justify-content: space-between; align-items: baseline; }
.slot-expbox .se-head b { font-size: 10px; color: #4a3a1a; }
.slot-expbox .se-head span { font-size: 9px; font-weight: 800; color: #8a6a26; }
.slot-expbox .se-bar { height: 6px; margin: 4px 0 4px; border-radius: 4px; background: rgba(150, 120, 70, 0.26); overflow: hidden; }
.slot-expbox .se-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6f9a4a, #aad478); }
.slot-expbox p { margin: 0; font-size: 8.5px; color: #7b6538; line-height: 1.4; }

/* 출진 — 병력 직접 입력 */
.hp-step .hp-count {
  border: 1px dashed #c3a568; border-radius: 6px; background: #fff8e6;
  min-width: 44px; padding: 2px 4px; text-align: center; font-size: 10px;
  color: #8a5f2a; font-weight: 800;
}
.hp-step .hp-count:active { background: #ffeec4; }
.troop-input { display: flex; flex-direction: column; gap: 7px; }
.troop-input label { font-size: 10px; font-weight: 800; color: #4a3a1a; display: flex; justify-content: space-between; }
.troop-input label em { font-style: normal; font-weight: 700; color: #8a6a26; }
.troop-input input {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1.5px solid #c3a568;
  background: #fffdf6; font-family: var(--serif); font-size: 20px; font-weight: 900;
  color: #2e2510; text-align: right; letter-spacing: 0.02em;
}
.troop-input .ti-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.troop-input .ti-quick button {
  flex: 1 1 auto; min-width: 52px; padding: 6px 4px; border-radius: 7px;
  border: 1px solid #c3a568; background: #f6ebd2; color: #5c4a24; font-size: 10px; font-weight: 800;
}
.troop-input .ti-note { margin: 0; font-size: 8.5px; color: #8a7448; }
.slot-card .sc-main small { white-space: nowrap; }
.slot-card .sc-up {
  display: inline-block; margin-left: 3px; padding: 0 3px; border-radius: 4px;
  font-size: 6.5px; font-weight: 900; color: #3a2d10; background: linear-gradient(180deg, #f2d27a, #dcae52);
  vertical-align: 1px;
}
.battle-objective.gate { color: #ffe1a4; border-color: rgba(255, 190, 90, 0.8); }

/* ═══════════════ v16 · 시나리오 선택 화면 (도안 A) ═══════════════ */
/* 어두운 먹·나무 결 바탕 위에 금테 가로 배너 4장. 왼쪽은 수채화 일러스트,
   오른쪽은 양피지로 녹아들며 연도 뱃지·제목·요약이 올라간다. */
#screen-scenario {
  background:
    radial-gradient(ellipse 82% 46% at 50% -6%, rgba(150, 106, 46, 0.42), transparent 68%),
    radial-gradient(ellipse 70% 40% at 50% 104%, rgba(122, 64, 24, 0.26), transparent 72%),
    repeating-linear-gradient(94deg, rgba(255, 222, 162, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(88deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 15px),
    linear-gradient(180deg, #2a1e11 0%, #1b1209 46%, #231708 76%, #150e07 100%);
  color: var(--paper);
  overflow: hidden;
}
#screen-scenario::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 214, 138, 0.16), transparent 42%),
    radial-gradient(ellipse 100% 70% at 50% 50%, transparent 48%, rgba(8, 5, 2, 0.62) 100%);
}
#screen-scenario > * { position: relative; z-index: 1; }

.sc-top {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: start;
  padding: calc(10px + env(safe-area-inset-top)) 14px 4px;
}
.sc-back {
  width: 40px; height: 40px; margin-top: 4px; border-radius: 50%;
  border: 2px solid #b08b3f; color: #f0d69c; font-size: 20px; line-height: 1;
  background: radial-gradient(circle at 50% 32%, #55401f, #2a1d0e 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 232, 176, 0.28), 0 3px 9px rgba(0, 0, 0, 0.5);
  display: grid; place-items: center;
}
.sc-back svg { width: 21px; height: 21px; display: block; }
.sc-back:active { transform: translateY(1px); filter: brightness(1.15); }
.sc-heading { text-align: center; padding-top: 2px; }
.sc-title {
  margin: 0; font-family: var(--serif); font-weight: 900;
  font-size: clamp(21px, 6.2vw, 27px); line-height: 1.18; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff6da 6%, #f0d494 42%, #c19a4a 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(60, 34, 8, 0.85)) drop-shadow(0 0 12px rgba(255, 206, 120, 0.35));
}
.sc-flourish {
  display: block; width: 128px; height: 9px; margin: 7px auto 0; position: relative;
  background: linear-gradient(90deg, transparent, rgba(206, 166, 84, 0.7) 50%, transparent);
}
.sc-flourish::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #dcb75e; box-shadow: 0 0 6px rgba(255, 214, 128, 0.7);
}

.sc-banners {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 8px 14px 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.scbn {
  position: relative; flex: 1 1 0; min-height: 122px; width: 100%; padding: 0;
  text-align: left; overflow: hidden; border-radius: 7px;
  border: 1.5px solid #b3903f;
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 252, 240, 0.62), transparent 46%),
    radial-gradient(ellipse 24% 40% at 74% 88%, rgba(158, 120, 62, 0.13), transparent 70%),
    radial-gradient(ellipse 30% 34% at 96% 44%, rgba(158, 120, 62, 0.1), transparent 72%),
    repeating-linear-gradient(0deg, rgba(120, 94, 48, 0.028) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, #e6d2a8 0%, #f3e5c4 44%, #f6ead0 68%, #ead9b4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 208, 0.55),
    inset 0 0 18px rgba(126, 90, 36, 0.2),
    0 1px 0 rgba(255, 226, 160, 0.2), 0 6px 14px rgba(0, 0, 0, 0.46);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.scbn::after {
  content: ''; position: absolute; inset: 3px; border-radius: 4px; pointer-events: none;
  border: 1px solid rgba(150, 112, 46, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 218, 0.35);
}
/* 네 모서리 금빛 장식 (ㄱ자 괄호) */
.scbn::before {
  content: ''; position: absolute; inset: 6px; pointer-events: none; z-index: 2; opacity: 0.8;
  background:
    linear-gradient(#c49d48, #c49d48) 0 0 / 14px 1.5px no-repeat,
    linear-gradient(#c49d48, #c49d48) 0 0 / 1.5px 14px no-repeat,
    linear-gradient(#c49d48, #c49d48) 100% 0 / 14px 1.5px no-repeat,
    linear-gradient(#c49d48, #c49d48) 100% 0 / 1.5px 14px no-repeat,
    linear-gradient(#c49d48, #c49d48) 0 100% / 14px 1.5px no-repeat,
    linear-gradient(#c49d48, #c49d48) 0 100% / 1.5px 14px no-repeat,
    linear-gradient(#c49d48, #c49d48) 100% 100% / 14px 1.5px no-repeat,
    linear-gradient(#c49d48, #c49d48) 100% 100% / 1.5px 14px no-repeat;
}
.scbn:active { transform: scale(0.994); filter: brightness(1.04); }

.scbn-art { position: absolute; inset: 0; display: block; }
.scbn-art img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 16% 50%;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 36%, rgba(0, 0, 0, 0.9) 48%, rgba(0, 0, 0, 0.35) 62%, transparent 72%);
  mask-image: linear-gradient(90deg, #000 0%, #000 36%, rgba(0, 0, 0, 0.9) 48%, rgba(0, 0, 0, 0.35) 62%, transparent 72%);
}
.scbn-body {
  position: absolute; top: 0; right: 0; bottom: 0; width: 40%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px 20px 6px 4px; text-align: center;
}
.scbn-year {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 74px; height: 40px; padding: 0 12px; border-radius: 50%;
  font-family: var(--serif); font-weight: 900; font-size: 23px; letter-spacing: 0.03em;
  color: #f6dc98; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 214, 130, 0.35);
  background-color: var(--ac, #7a2b26);
  background-image:
    radial-gradient(ellipse 70% 62% at 50% 24%, rgba(255, 255, 255, 0.24), transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.34) 100%);
  border: 2px solid #d3ac56;
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 168, 0.45),
    inset 0 -4px 9px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(60, 34, 8, 0.42);
}
.scbn-name {
  font-family: var(--serif); font-weight: 900; font-size: clamp(14px, 4.4vw, 18px);
  line-height: 1.24; letter-spacing: -0.01em; color: #2c1d0c;
  text-shadow: 0 1px 0 rgba(255, 248, 228, 0.72);
  word-break: keep-all;
}
.scbn-meta {
  font-size: 8.5px; font-weight: 700; line-height: 1.35; color: #8a6a32;
  letter-spacing: -0.02em; max-width: 100%;
}
.scbn-go {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--serif); font-size: 22px; font-weight: 900; line-height: 1; color: #8a6626;
  text-shadow: 0 1px 0 rgba(255, 248, 228, 0.85);
}

/* v5.18 — 2·3·4막 자리: '새 컨텐츠 준비중' 잠금 카드 (누르면 준비중 토스트만) */
.scbn.soon {
  cursor: default; border-style: dashed; border-color: #9a834f;
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 208, 0.35),
    inset 0 0 18px rgba(96, 74, 34, 0.28),
    0 1px 0 rgba(255, 226, 160, 0.12), 0 6px 14px rgba(0, 0, 0, 0.42);
}
.scbn.soon .scbn-art img {
  filter: grayscale(0.82) brightness(0.72) contrast(0.9) sepia(0.18);
  opacity: 0.9;
}
.scbn.soon .scbn-body { opacity: 0.94; }
.scbn.soon .scbn-year {
  background-color: #5f5847; border-color: #bfae7d; color: #f0e8d2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.scbn.soon .scbn-name { color: #4a3c24; }
.scbn.soon .scbn-sub { color: #6f5f3e; }
.scbn.soon::before { opacity: 0.4; }
.scbn.soon:active { transform: scale(0.994); filter: brightness(1.03); }
.scbn-soon-tag {
  position: absolute; left: 12px; top: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px;
  font-family: var(--sans); font-size: 9px; font-weight: 900; letter-spacing: 0.02em;
  color: #f6eed8; background: rgba(48, 39, 24, 0.82);
  border: 1px solid rgba(214, 189, 133, 0.66);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.scbn-lock {
  position: absolute; right: 9px; top: 8px; z-index: 3;
  font-size: 15px; line-height: 1; opacity: 0.82;
  filter: grayscale(0.35) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.sc-foot {
  margin: 0; padding: 6px 14px calc(9px + env(safe-area-inset-bottom));
  text-align: center; font-size: 10px; color: #c4a877; letter-spacing: -0.01em;
}
.sc-foot-ic { color: #dcb75e; margin-right: 3px; }

@media (min-width: 620px) {
  .sc-top, .sc-banners, .sc-foot { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; }
}

@media (max-height: 720px) {
  .scbn { min-height: 112px; }
  .scbn-year { min-width: 64px; height: 34px; font-size: 20px; }
  .scbn-name { font-size: 15px; }
  .scbn-body { width: 42%; padding-right: 17px; }
  .scbn-meta { font-size: 8px; }
  .sc-title { font-size: 21px; }
  .sc-flourish { margin-top: 4px; }
}

/* ══════════════════════════════════════════════════════════════
   v5.3 — 세력 선택 전용 화면 · 성 내성 양피지+금테 톤 · 행군 마커
   ══════════════════════════════════════════════════════════════ */

/* ── 세력 선택 (#screen-faction) — 시나리오 화면과 같은 먹·나무결·금테 ── */
#screen-faction {
  flex-direction: column;
  background:
    radial-gradient(ellipse 82% 46% at 50% -6%, rgba(150, 106, 46, 0.42), transparent 68%),
    radial-gradient(ellipse 70% 40% at 50% 104%, rgba(122, 64, 24, 0.26), transparent 72%),
    repeating-linear-gradient(94deg, rgba(255, 222, 162, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(88deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 15px),
    linear-gradient(180deg, #2a1e11 0%, #1b1209 46%, #231708 76%, #150e07 100%);
  color: var(--paper); overflow: hidden;
}
#screen-faction.active { display: flex; }
#screen-faction::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 100% 70% at 50% 50%, transparent 48%, rgba(8, 5, 2, 0.62) 100%);
}
#screen-faction > * { position: relative; z-index: 1; }
.fx-era {
  margin: 2px 14px 0; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 6px;
  border: 1px solid rgba(190, 150, 80, 0.5);
  background: linear-gradient(180deg, rgba(78, 57, 27, 0.6), rgba(26, 19, 9, 0.62));
  box-shadow: inset 0 0 0 1px rgba(255, 230, 170, 0.12), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.fx-year {
  flex: 0 0 auto; font-family: var(--serif); font-size: 19px; font-weight: 900; line-height: 1;
  color: #f6da96; letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 210, 120, 0.35);
}
.fx-note-wrap { min-width: 0; }
.fx-scname { display: block; font-family: var(--serif); font-size: 11.5px; color: #f0dcae; letter-spacing: -0.01em; }
.fx-note {
  margin: 1px 0 0; font-size: 9.5px; line-height: 1.42; color: #c9b083; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: keep-all;
}
.fx-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px 12px 4px;
}
.fx-empty { grid-column: 1 / -1; font-size: 11px; color: #c4a877; text-align: center; padding: 20px 0; }
.fx-card {
  position: relative; display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 7px 6px 7px 7px; text-align: left; border-radius: 6px;
  border: 1.5px solid #b3903f;
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 252, 240, 0.55), transparent 46%),
    radial-gradient(ellipse 26% 44% at 78% 88%, rgba(158, 120, 62, 0.12), transparent 72%),
    repeating-linear-gradient(0deg, rgba(120, 94, 48, 0.03) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, #e7d3aa 0%, #f4e6c6 52%, #f0dfba 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 208, 0.5),
    inset 0 0 16px rgba(126, 90, 36, 0.18),
    0 5px 12px rgba(0, 0, 0, 0.44);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.fx-card::after {
  content: ''; position: absolute; inset: 3px; border-radius: 3px; pointer-events: none;
  border: 1px solid rgba(150, 112, 46, 0.35);
}
.fx-card:active { transform: scale(0.98); filter: brightness(1.05); }
.fx-port { position: relative; flex: 0 0 46px; width: 46px; height: 56px; }
.fx-port img {
  width: 46px; height: 56px; object-fit: cover; object-position: 50% 16%;
  border: 1.5px solid #d3ac56; border-radius: 4px; background: #3a2b13;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 240, 200, 0.25);
}
.fx-badge {
  position: absolute; left: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 4px;
  display: grid; place-items: center; color: #fff8e8;
  font-family: var(--serif); font-size: 10.5px; font-weight: 900;
  background: var(--fc, #8b8677); border: 1.5px solid #f0d69c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
/* v5.13 — 군주 등급(S/A) 배지 — 시공초월 올스타 */
.fx-tier {
  position: absolute; right: -5px; top: -5px; min-width: 16px; height: 16px; padding: 0 3px;
  display: grid; place-items: center; border-radius: 8px; font-style: normal;
  font-family: var(--serif); font-size: 9.5px; font-weight: 900; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, #8b8677 0%, #6f6a5c 58%, #565246 100%);
  border: 1.2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
/* v5.24 — 군주 등급 4색: S 빨강 · A 보라 · B 파랑 · C 초록 */
.fx-tier.t-S { background: linear-gradient(180deg, #e03c2d 0%, #bd2a1d 55%, #a81d13 100%); border-color: #ff9384; box-shadow: 0 1px 4px rgba(120, 15, 8, .6), inset 0 0 0 1px rgba(255, 255, 255, .3); }
.fx-tier.t-A { background: linear-gradient(180deg, #9248cc 0%, #7a35b0 55%, #632599 100%); border-color: #d9b3f7; box-shadow: 0 1px 4px rgba(70, 20, 110, .6), inset 0 0 0 1px rgba(255, 255, 255, .3); }
.fx-tier.t-B { background: linear-gradient(180deg, #3274d9 0%, #2558b5 55%, #1c4d9e 100%); border-color: #a9c9ff; box-shadow: 0 1px 4px rgba(15, 45, 110, .6), inset 0 0 0 1px rgba(255, 255, 255, .3); }
.fx-tier.t-C { background: linear-gradient(180deg, #32945c 0%, #26774a 55%, #1e663d 100%); border-color: #a3e3bf; box-shadow: 0 1px 4px rgba(15, 70, 45, .6), inset 0 0 0 1px rgba(255, 255, 255, .3); }
.fx-main { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.fx-name {
  font-family: var(--serif); font-size: 13px; font-weight: 900; line-height: 1.22; color: #2c1d0c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 248, 228, 0.7);
}
.fx-lord { font-size: 9px; font-weight: 800; color: #6f5527; line-height: 1.3; }
.fx-cap { font-size: 8.5px; color: #8a6a32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.fx-nums { display: flex; gap: 6px; margin-top: 2px; }
.fx-nums i { font-style: normal; font-size: 8px; color: #7b5f2c; white-space: nowrap; }
.fx-nums b { font-family: var(--serif); font-size: 10px; color: #3a2a10; }
@media (max-width: 359px) {
  .fx-list { grid-template-columns: 1fr; }
}

/* ── 성 내성 — 하얀 스티커 대신 금테 목재 명패, 양피지+금테 패널 ── */
.yard-b .yb-ico {
  background: none; border: 0; box-shadow: none;
  filter: drop-shadow(0 3px 5px rgba(18, 12, 3, 0.55));
}
.yard-b .yb-ico img { width: 44px; height: 44px; filter: drop-shadow(0 2px 2px rgba(18, 12, 3, 0.45)); }
.yard-b .yb-lv {
  background: linear-gradient(180deg, #d0a24a, #7c5518);
  border: 1px solid #f4d894; color: #fff9ea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 250, 226, 0.4);
}
.yard-b .yb-tag, .hotspot span {
  margin-top: 2px; padding: 1.5px 7px 2.5px; border-radius: 3px;
  font-family: var(--serif); font-size: 9px; font-weight: 800; letter-spacing: 0.04em;
  color: #f8e6ba; white-space: nowrap;
  background:
    repeating-linear-gradient(90deg, rgba(255, 222, 160, 0.055) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #5d411d 0%, #382611 52%, #241708 100%);
  border: 1px solid #c9a24e;
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 194, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.42),
    0 2px 4px rgba(10, 6, 2, 0.52);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.yard-b .yb-exp { background: rgba(18, 12, 4, 0.55); }
.yard-b .yb-exp i { background: linear-gradient(90deg, #b98a2a, #f0d07a); }
.yard-b.empty .yb-ico {
  background: radial-gradient(circle at 50% 42%, rgba(46, 34, 15, 0.62), rgba(20, 14, 6, 0.42));
  border: 1.5px dashed rgba(232, 198, 122, 0.85); border-radius: 12px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.yard-b.empty .yb-plus { color: #f2d79a; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hotspot.office .hs-ico {
  width: 44px; height: 44px; padding: 3px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(70, 49, 20, 0.94), rgba(28, 19, 8, 0.94));
  border: 1.5px solid #d3ac56;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 186, 0.3), 0 3px 8px rgba(8, 5, 2, 0.6);
  filter: drop-shadow(0 2px 4px rgba(14, 9, 2, 0.6));
}

.city-dev {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(126, 94, 48, 0.028) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #f8eed6 0%, #f2e3c2 58%, #ecd8b2 100%);
  border-top: 1px solid rgba(174, 130, 52, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, 0.7);
}
.city-dev::before {
  content: ''; position: absolute; inset: 2px 6px; border: 1px solid rgba(160, 124, 60, 0.22);
  border-radius: 4px; pointer-events: none;
}
.city-dev .dev-lv {
  background: linear-gradient(180deg, #b8862f, #7a5417);
  border-color: #f0d69c; box-shadow: 0 1px 3px rgba(90, 60, 20, 0.35);
}
.city-dev .dev-name { color: #3b2a10; font-weight: 800; }
.city-dev .dev-bar { background: #dcc9a0; box-shadow: inset 0 1px 2px rgba(90, 70, 30, 0.28); }
.city-dev .dev-bars { position: relative; z-index: 1; }
.city-dev .dev-head { position: relative; z-index: 1; }

.city-general-strip {
  background: linear-gradient(180deg, #f3e4c4, #e8d4ab);
  border-top: 1px solid rgba(174, 130, 52, 0.4);
}
.gen-chip {
  border-radius: 6px; border: 1.5px solid #c9a24e;
  background:
    repeating-linear-gradient(0deg, rgba(126, 94, 48, 0.03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #fffaf0, #f4e5c4);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 232, 0.65), 0 2px 5px rgba(80, 60, 20, 0.16);
}
.gen-chip.duty { border-color: #b8862f; box-shadow: inset 0 0 0 1px rgba(255, 236, 180, 0.6), 0 0 0 1px rgba(184, 134, 47, 0.25); }

.city-groups { gap: 3px; }
.city-groups .cmd {
  position: relative; margin: 0 1px; padding: 3px 0 2px; border-radius: 7px;
  background:
    repeating-linear-gradient(0deg, rgba(126, 94, 48, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #fbf3dd 0%, #f2e2bd 60%, #e8d3a8 100%);
  border: 1px solid #c9a24e;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 230, 0.7), 0 2px 4px rgba(80, 60, 20, 0.18);
}
.city-groups .cmd:active { background: linear-gradient(180deg, #f6e9c8, #e9d5a8); }
.city-groups .cmd-ic {
  width: 26px; height: 26px; border: 0; background: transparent; box-shadow: none;
  color: #6b4f1c; font-size: 15px;
}
.city-groups .cmd b { color: #3a2a10; font-family: var(--serif); font-size: 10.5px; }
.city-groups .cmd small { color: #8a7444; }
.city-groups .cmd.next {
  background: linear-gradient(180deg, #b4553f, #8a3629);
  border-color: #e3bd63;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 170, 0.35), 0 2px 6px rgba(90, 30, 16, 0.3);
}
.city-groups .cmd.next b { color: #ffe9c6; }
.city-groups .cmd.next .cmd-ic { color: #ffe9c6; background: transparent; border: 0; }

/* ── 지도 위 행군 마커 ── */
.march-mark {
  position: absolute; left: 0; top: 0; margin: -13px 0 0 -13px; z-index: 6; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.march-mark .mm-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 34%, #f0d69c, #8a5f1d 70%, #4a3210);
  border: 1.5px solid #ffe6ac; color: #3a2a10;
  font-size: 13px; font-weight: 900;
  box-shadow: 0 0 0 3px rgba(255, 214, 120, 0.22), 0 3px 8px rgba(0, 0, 0, 0.5);
  animation: marchPulse 1.8s ease-in-out infinite;
}
.march-mark .mm-tag {
  font-family: var(--serif); font-size: 8px; font-weight: 800; color: #fff3d0;
  padding: 0 5px; border-radius: 3px; white-space: nowrap;
  background: rgba(32, 22, 8, 0.85); border: 1px solid rgba(227, 189, 99, 0.65);
}
@keyframes marchPulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 214, 120, 0.18), 0 3px 8px rgba(0, 0, 0, 0.5); } 50% { box-shadow: 0 0 0 7px rgba(255, 214, 120, 0.06), 0 3px 8px rgba(0, 0, 0, 0.5); } }
/* v5.47 — [성에서 기다리기]로 다음 달로 미뤄진 침공 표식 (붉게 두드려 보인다) */
.march-mark.siege-soon { z-index: 7; }
.march-mark.siege-soon .mm-dot {
  background: radial-gradient(circle at 50% 34%, #f4a08c, #a2331f 70%, #4d120a);
  border-color: #ffc9b5; color: #fff2ec;
  animation: siegePulse 1.5s ease-in-out infinite;
}
.march-mark.siege-soon .mm-tag { color: #ffe0d4; border-color: rgba(226, 122, 96, 0.75); }
@keyframes siegePulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(226, 92, 60, 0.28), 0 3px 8px rgba(0, 0, 0, 0.5); } 50% { box-shadow: 0 0 0 9px rgba(226, 92, 60, 0.10), 0 3px 8px rgba(0, 0, 0, 0.5); } }

/* ── 출진 준비 — 행군 안내 · 등용 확률 ── */
.march-note {
  display: flex; align-items: center; gap: 6px; margin: 6px 0 2px;
  padding: 6px 8px; border-radius: 7px;
  background: rgba(255, 248, 230, 0.85); border: 1px solid #d7bd8c;
  font-size: 10px; line-height: 1.45; color: #5b4a27;
}
.march-note b { color: #8a5a12; font-family: var(--serif); }
.gp-rate { font-style: normal; font-size: 9.5px; font-weight: 900; color: #2f6f4a; }
.gp-rate.low { color: #a8443a; }
.gp-rate.mid { color: #8a6a26; }
.gen-pick .gp-cost small { display: block; font-size: 8px; font-weight: 700; color: #8a7448; }

/* v5.3 — 건물 담당 추천 배지 · 행군 사건 카드 */
.duty-reco {
  display: inline-block; font-style: normal; font-size: 7.5px; font-weight: 900; letter-spacing: 0.02em;
  color: #fff6da; background: linear-gradient(180deg, #b8862f, #7a5417);
  border: 1px solid #e8c877; border-radius: 4px; padding: 0 4px; margin-left: 2px;
  vertical-align: 1px;
}
.march-event { display: flex; flex-direction: column; gap: 7px; }
.march-event .me-flag {
  align-self: flex-start; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center;
  color: #fff8e8; font-family: var(--serif); font-weight: 900; font-size: 13px;
  border: 1.5px solid #f0d69c; box-shadow: 0 2px 5px rgba(60, 40, 10, 0.35);
}
.march-event p { margin: 0; font-size: 11px; line-height: 1.55; color: #4a3a1a; }
.march-event .me-nums { display: flex; gap: 12px; font-size: 10px; color: #7b6538; }
.march-event .me-nums b { font-family: var(--serif); font-size: 14px; color: #33280f; }
.march-event .me-note { font-size: 9.5px; color: #8a7448; }

/* ══════════════════════════════════════════════════════════════
   v5.4 — 월 수지 줄 · 월정산 금/군량 결산 · 🌾 10월 대수확 · 경제 현황
   ══════════════════════════════════════════════════════════════ */

/* 지도 상단 월 수지 줄 (누르면 경제 현황) */
.econ-strip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  align-self: center; max-width: calc(100% - 16px);
  margin: 0 8px 3px; padding: 3px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: -0.01em; color: #5a4418;
  background: linear-gradient(180deg, rgba(255, 250, 236, 0.96), rgba(244, 229, 196, 0.92));
  border: 1px solid #d9bf88;
  box-shadow: inset 0 0 0 1px rgba(255, 252, 240, 0.6), 0 1px 3px rgba(90, 70, 30, 0.14);
}
.econ-strip i { width: 1px; height: 9px; background: #cdb384; flex: 0 0 auto; }
.econ-strip span { white-space: nowrap; }
.econ-strip .es-gold { color: #8a5a12; }
.econ-strip .es-food { color: #3f6b34; }
.econ-strip .es-harvest { color: #a06a10; }
.econ-strip .down { color: #a8443a; }
.econ-strip .es-harvest.soon { color: #b4553f; }
.econ-strip .es-harvest.done { color: #2f7a3c; }
.econ-strip:active { background: linear-gradient(180deg, #f6e9c8, #e9d5a8); }

/* 월정산 — 금/군량 구역 머리말 · 합계 · 부족 경고 */
.month-report .mr-sec {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 5px; padding: 0 3px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.12em; color: #8a6b2c;
}
.month-report .mr-sec em { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0; color: #a08954; }
.mr-row b.minus { color: #a8443a; }
.mr-row em { font-style: normal; font-size: 9px; font-weight: 600; color: #8a7448; margin-left: 4px; }
.mr-row.total {
  background: linear-gradient(100deg, #f7ecd2, #efdcb4);
  border-color: #c9a24e; font-weight: 800;
}
.mr-row.total b { display: flex; align-items: baseline; gap: 5px; }
.mr-row.total b em { font-size: 9px; color: #8a7448; margin-left: 0; }
.mr-row.famine {
  background: linear-gradient(100deg, #fbe9e0, #f3d3c2);
  border-color: #d08e78;
}
.mr-row.famine span { color: #8f3226; font-weight: 800; }
.mr-harvest {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px;
  background: linear-gradient(100deg, #fdf4d2, #f0dc97);
  border: 1px solid #d9b64e;
  box-shadow: 0 2px 8px rgba(160, 120, 20, 0.22), inset 0 0 0 1px rgba(255, 251, 224, 0.7);
  animation: harvestGlow 2.4s ease-in-out infinite;
}
.mr-harvest .mh-ic { font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(120, 80, 0, 0.3)); }
.mr-harvest .mh-main { flex: 1; min-width: 0; }
.mr-harvest .mh-main b { display: block; font-family: var(--serif); font-size: 13px; color: #714a06; }
.mr-harvest .mh-main span { display: block; font-size: 9px; color: #8a6a2e; line-height: 1.35; }
.mr-harvest em { font-style: normal; font-family: var(--serif); font-size: 15px; font-weight: 800; color: #2f6b2c; white-space: nowrap; }
@keyframes harvestGlow {
  0%, 100% { box-shadow: 0 2px 8px rgba(160, 120, 20, 0.2), inset 0 0 0 1px rgba(255, 251, 224, 0.7); }
  50% { box-shadow: 0 3px 14px rgba(190, 145, 20, 0.36), inset 0 0 0 1px rgba(255, 255, 240, 0.9); }
}

/* 경제 현황 모달 */
.econ-modal { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: #4a3d20; }
.econ-modal .ec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px; padding: 3px 3px 2px; border-bottom: 1px dashed #d3bd8c;
}
.econ-modal .ec-head > span { font-family: var(--serif); font-size: 13px; font-weight: 800; color: #3a2a10; }
.econ-modal .ec-head em { font-size: 9.5px; font-style: normal; color: #8a7448; }
.econ-modal .ec-head em b { font-size: 11px; color: #3a2a10; }
.ec-line { display: flex; justify-content: space-between; gap: 8px; padding: 3px 4px; }
.ec-line b { font-weight: 800; }
.ec-line b.plus { color: #3f7a3c; }
.ec-line b.minus { color: #a8443a; }
.ec-line.sum { background: rgba(247, 236, 210, 0.9); border-radius: 6px; font-weight: 800; }
.ec-harvest {
  margin: 7px 0 2px; padding: 8px 9px; border-radius: 10px;
  background: linear-gradient(100deg, #fdf4d2, #f0dc97); border: 1px solid #d9b64e;
}
.eh-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.eh-top b { font-family: var(--serif); font-size: 12px; color: #714a06; }
.eh-top em { font-size: 9px; font-style: normal; color: #8a6a2e; }
.eh-num { font-family: var(--serif); font-size: 16px; font-weight: 800; color: #2f6b2c; margin: 2px 0; }
.eh-num i { font-style: normal; font-size: 10px; color: #6b7a4a; }
.ec-harvest p { margin: 2px 0 5px; font-size: 9.5px; line-height: 1.45; color: #6b5830; }
.eh-cities { display: flex; flex-direction: column; gap: 2px; }
.ec-city { display: flex; align-items: baseline; gap: 5px; font-size: 9.5px; color: #5c4a24; }
.ec-city b { font-size: 10px; color: #3a2a10; }
.ec-city span { flex: 1; min-width: 0; color: #8a7448; }
.ec-city em { font-style: normal; font-weight: 800; color: #2f6b2c; }
.ec-pays { display: flex; flex-wrap: wrap; gap: 3px; }
.ec-pay {
  display: flex; align-items: baseline; gap: 4px; padding: 2px 7px; border-radius: 999px;
  background: #fffaf0; border: 1px solid #d9c49a; font-size: 9px; color: #6b5830;
}
.ec-pay b { font-size: 10px; color: #3a2a10; }
.ec-pay em { font-style: normal; font-weight: 800; color: #a8443a; }
.ec-note { margin: 6px 0 0; font-size: 9px; color: #8a7448; line-height: 1.45; }

/* v5.4 — 내성 화면 하단 장수 칩 초상도 상단 군주 초상처럼 둥근 네모 금테 (원형 → 사각) */
.city-general-strip .gen-chip img {
  border-radius: 10px;
  border: 1.5px solid var(--gold, #b8862f);
  box-shadow: 0 1px 3px rgba(80, 60, 20, 0.22);
}

/* v5.4 — 장수 명부: 이름 아래 병종 배지를 두 줄로 (390px에서도 넘치지 않게) */
.rs-name .rs-nm { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.rs-name .rs-nm-top { display: flex; align-items: baseline; gap: 2px; min-width: 0; max-width: 100%; }
.rs-name .rs-nm-top b { min-width: 0; }
.rs-cls {
  font-style: normal; font-size: 7.5px; font-weight: 800; letter-spacing: -0.02em;
  color: #6b4a12; background: #f7e8c6; border: 1px solid #d9bf88; border-radius: 4px;
  padding: 0 3px; line-height: 1.35; white-space: nowrap;
}

/* v5.4 — 장수 줄 끝 '전' 아이콘: 칩 안에서 찌그러지거나 잘리지 않게 */
.city-general-strip .gen-chip .gc-all {
  display: grid; place-items: center; flex: 0 0 auto; align-self: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--serif); font-size: 14px; font-weight: 700; line-height: 1;
  color: #7a5a2a; background: radial-gradient(circle at 50% 38%, #fbf1d8, #eddfbc);
  border: 1px solid #c3a568; box-sizing: border-box;
}
.city-general-strip .gen-chip.all { align-items: center; }

/* v5.4 — 건물 담당 [추천] 배지: 어두운 배경 + 선명한 흰 글씨로 대비를 확실히 */
.duty-reco, .slot-card .duty-reco {
  display: inline-block; font-style: normal; font-size: 7.5px; font-weight: 800; letter-spacing: 0.02em;
  color: #ffffff !important;
  background: #2e6f40 !important;
  border: 1px solid #1f4d2b; border-radius: 4px; padding: 0 4px; margin-left: 2px;
  vertical-align: 1px; line-height: 1.5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 2px rgba(20, 50, 25, 0.3);
}

/* v5.4 — 월정산: 시설별 경험치 획득 · 증축 가능 표시 */
.mr-grow { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 9px;
  background: rgba(255, 250, 236, 0.75); border: 1px solid #e0cda6; }
.mr-grow-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 1px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; color: #47673c; }
.mr-grow-title em { font-style: normal; font-size: 8px; font-weight: 600; letter-spacing: 0; color: #9a8a66; }
.mr-grow-row { display: grid; grid-template-columns: 1fr 42px auto; align-items: center; gap: 5px; font-size: 9px; color: #4a3d20; }
.mr-grow-row b { font-size: 9.5px; font-weight: 700; color: #33280f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-grow-row b i { font-style: normal; font-size: 8px; color: #8a7448; }
.mg-bar { height: 5px; border-radius: 3px; background: #e6d7b4; overflow: hidden; }
.mg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6f9b3c, #9cc45c); border-radius: 3px; }
.mr-grow-row em { font-style: normal; font-size: 8.5px; font-weight: 700; color: #5c6b46; white-space: nowrap; }
.mr-grow-row em i { font-style: normal; font-weight: 600; color: #94824f; }
.mr-grow-row.up em { color: #2e6f40; }
.mr-grow-row.up .mg-bar i { background: linear-gradient(90deg, #2e6f40, #4b9a5c); }

/* v5.4 — 장수 상태 줄 [자동 배속] 버튼 (빈 건물에 최적 장수를 한 번에) */
.ap-auto {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1px solid #47673c; border-radius: 8px; padding: 3px 8px 3px 6px;
  background: linear-gradient(180deg, #eef6e2, #d8e8c4); color: #2e5b2c; font-size: 9.5px; font-weight: 800;
  box-shadow: 0 1px 3px rgba(50, 80, 40, 0.22);
}
.ap-auto span { font-family: var(--serif); font-size: 9px; background: #2e6f40; color: #fff;
  border-radius: 4px; padding: 1px 4px; }
.ap-auto:active { filter: brightness(0.96); }
.ap-auto.dim { opacity: 0.45; }
.ap-row2 { gap: 5px; }
.ap-row2 .ap-delegate { padding: 3px 7px 3px 5px; }

/* v5.4 — 관아 표지: 지붕 위에 둥둥 뜬 원형 아이콘을 걷어내고,
   처마 아래에 매단 금테 목재 간판(🏛 관아)으로 자리 잡게 한다 */
.hotspot.office { gap: 0; }
.hotspot.office .hs-ico { display: none; }
.hotspot.office::before {
  content: ''; display: block; width: 2px; height: 9px;
  background: linear-gradient(180deg, rgba(217, 178, 92, 0), rgba(217, 178, 92, 0.9));
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
  margin-bottom: -1px;
}
.hotspot.office .hs-sign {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 4px; border-radius: 4px;
  font-family: var(--serif); font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  color: #ffe9b0; white-space: nowrap;
  background:
    repeating-linear-gradient(90deg, rgba(255, 222, 160, 0.05) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #6b4a20 0%, #432c11 55%, #2a1907 100%);
  border: 1.5px solid #d9b25c;
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 194, 0.34),
    inset 0 -2px 5px rgba(0, 0, 0, 0.45),
    0 3px 7px rgba(10, 6, 2, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.hotspot.office:active .hs-sign { filter: brightness(1.08); }

/* ══════════════════════════════════════════════════════════════
   v5.5 — 성 안 백성·병사 모션 캔버스 · 헤더 날짜 · 인구 증감
   ══════════════════════════════════════════════════════════════ */
/* v5.34 — 걷는 도트 시민 6종(assets/townsfolk)과 조그만 말풍선도 이 캔버스가 그린다 */
.city-life {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.city-scene .scene-hotspots { z-index: 2; }
.city-scene .city-weather, .city-scene .btn-city-map { z-index: 3; }

.city-title-wrap .city-date {
  align-self: center; font-size: 9.5px; font-weight: 800; color: #5f4a22;
  background: #f6ead0; border: 1px solid #cdb489; border-radius: 7px; padding: 0 6px;
  letter-spacing: -0.01em; white-space: nowrap;
}
.dev-pop .dp-delta {
  font-style: normal; font-size: 9px; font-weight: 800; margin-left: 3px;
  color: #4f7a2c;
}
.dev-pop .dp-delta.down { color: #a8443a; }
.ci-item em.ci-pop { color: #4f7a2c; font-weight: 700; }
.ap-best {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 2px;
  border: 1px solid #c3a568; border-radius: 12px; padding: 1px 7px 1px 4px;
  background: linear-gradient(180deg, #fdf6e4, #ebd9b3);
  font-size: 8.5px; font-weight: 800; color: #7a6538; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(90, 70, 30, 0.14);
}
.ap-best i {
  width: 7px; height: 7px; border-radius: 50%; background: #b9a77c;
  box-shadow: inset 0 0 0 1px rgba(90, 70, 30, 0.35);
}
.ap-best.on { color: #2e6f40; border-color: #7ea36a; background: linear-gradient(180deg, #f2f8e8, #dcecc9); }
.ap-best.on i { background: #3f8a4e; box-shadow: 0 0 0 2px rgba(63, 138, 78, 0.18); }

/* v5.5 — 정찰된 적성 장수: 둥근 네모 금테 초상 + 병종/직업 배지 */
.mini-gen .mg-frame {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; overflow: hidden;
  border: 1.5px solid #d8b25c; background: #2b2113;
  box-shadow: 0 0 0 1.5px rgba(255, 236, 186, 0.45), 0 2px 5px rgba(20, 12, 4, 0.45);
}
.mini-gen .mg-frame img {
  width: 100%; height: 100%; border-radius: 0; object-fit: cover; object-position: 50% 16%;
  box-shadow: none;
}
.mini-gen .mg-job {
  display: inline-block; align-self: flex-start; margin: 1px 0 0;
  font-size: 7.5px; font-weight: 800; letter-spacing: -0.01em;
  padding: 0 4px; border-radius: 4px; color: #fff8e6;
  background: linear-gradient(180deg, #7a6a4a, #544730); border: 1px solid rgba(255, 240, 200, 0.35);
}
.mg-job.j-gibi, .mg-job.j-gunggi { background: linear-gradient(180deg, #8a4a35, #632f20); }
.mg-job.j-changbyung, .mg-job.j-geombyung, .mg-job.j-deunggabyung { background: linear-gradient(180deg, #4a6d9c, #2f4a70); }
.mg-job.j-gungsu, .mg-job.j-yeonnobyung { background: linear-gradient(180deg, #4f7a3c, #315324); }
.mg-job.j-chaeksa, .mg-job.j-pungsusa, .mg-job.j-dosa { background: linear-gradient(180deg, #6a4a8a, #452f61); }
.mg-job.j-sujeok, .mg-job.j-sanjeok { background: linear-gradient(180deg, #3f6b7a, #284a56); }
.mg-job.j-muhui, .mg-job.j-gunakdae { background: linear-gradient(180deg, #a85a7a, #74395a); }
.mg-job.j-gunwoong { background: linear-gradient(180deg, #b8862f, #7a5417); }
.tc-portrait.gold { border-radius: 9px; border: 1.5px solid #d8b25c; box-shadow: 0 0 0 1.5px rgba(255, 236, 186, 0.4); }

/* v5.5 — 주점 사신 고르기 줄 */
/* v5.65 — 사신 칩이 오른쪽에서 잘리지 않게 줄바꿈 (가로 스크롤 대신) */
.envoy-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 5px 2px 7px; margin-bottom: 2px;
  border-bottom: 1px dashed rgba(150, 120, 60, 0.35);
  -webkit-overflow-scrolling: touch;
}
.envoy-row .ev-label {
  flex: 0 0 auto; font-family: var(--serif); font-size: 10px; font-weight: 800;
  color: #7a5417; background: #f3e3bd; border: 1px solid #d8bd82; border-radius: 6px; padding: 1px 6px;
}
.envoy-row .ev-none { font-size: 9.5px; color: #8a7448; }
.ev-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #cdb489; border-radius: 20px; padding: 1px 8px 1px 1px;
  background: linear-gradient(180deg, #fffaf0, #f1e2c2); color: #4a3a1a;
  font-size: 10px; font-weight: 700;
}
.ev-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid #b8862f; }
.ev-chip em { font-style: normal; font-size: 8.5px; color: #8a7448; font-weight: 800; }
.ev-chip.on { border-color: #b8862f; background: linear-gradient(180deg, #fff3d2, #ecd39a); box-shadow: 0 0 0 1px rgba(184, 134, 47, 0.35); }
.dev-head .dev-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-head .dev-pop { flex: 0 0 auto; white-space: nowrap; }
.sheet-gens .mini-gen > div { flex: 0 0 auto; min-width: 0; }
.sheet-gens .mini-gen em { white-space: nowrap; }
.sheet-gens .mini-gen { padding: 2px 9px 2px 2px; }

/* ══════════════════════════════════════════════════════════════
   v5.7 — 내정 편의 · 태수 위임 방침 · 충성 · 시세 · 세계제패 AI
   ══════════════════════════════════════════════════════════════ */
/* 출진 모달 — 소속 성 · 현재 상태 배지, 긴 장수명 줄바꿈 방지 */
.hp-main { min-width: 0; }
.hp-main b { white-space: nowrap; overflow: visible; }
.hp-badges { display: flex; flex-wrap: nowrap; gap: 3px; margin-top: 2px; align-items: center; }
.hp-badges i {
  font-style: normal; font-size: 8px; font-weight: 800; letter-spacing: -0.01em;
  padding: 0 4px; border-radius: 4px; white-space: nowrap;
  border: 1px solid #cdb489; background: #f6ead0; color: #7a5f24;
}
.hp-badges i.hp-duty-wait { border-color: #9dbb86; background: #eef6e0; color: #4f7a2c; }
.hp-badges i.hp-duty-busy { border-color: #d3a07a; background: #fbeee0; color: #a4652a; }
.hp-badges i.hp-loyal-low { border-color: #c98a80; background: #fbe6e2; color: #a8443a; }
.hero-pick.busy { background: rgba(250, 240, 222, 0.55); }
.hero-pick .hp-main b { font-size: 12px; line-height: 1.15; }
.deploy-list .hero-pick { gap: 6px; }

/* 내성 시설 — [모두 증축] */
.slot-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot-head .slot-upall {
  flex: 0 0 auto; border-radius: 8px; padding: 3px 8px; font-size: 9.5px; font-weight: 900;
  color: #6a4a10; background: linear-gradient(180deg, #ffe9ae, #e9c871);
  border: 1.5px solid #b8862f; box-shadow: 0 1px 3px rgba(120, 90, 30, 0.28);
  display: inline-flex; align-items: center; gap: 4px;
}
.slot-head .slot-upall em { font-style: normal; font-size: 8.5px; font-weight: 800; color: #7a5f24; }
.slot-head .slot-upall:disabled { opacity: 0.55; }
.upall-row { display: flex; align-items: center; gap: 7px; padding: 4px 2px; border-bottom: 1px dashed rgba(150, 120, 60, 0.28); }
.upall-row img { width: 26px; height: 26px; object-fit: contain; }
.upall-row b { flex: 1; font-size: 11.5px; color: #2e2510; }
.upall-row span { font-size: 10px; color: #7b6538; }
.upall-row em { font-style: normal; font-size: 10.5px; font-weight: 800; color: #8a5f2a; }
.upall-total { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; font-weight: 800; color: #4a3a1a; }
.upall-total b { color: #a8443a; font-size: 13px; }

/* 관아 — 태수 위임 방침 5종 */
.office-policy { margin: 6px 0 2px; }
.office-policy > p { margin: 0 0 4px; font-size: 9.5px; font-weight: 800; color: #7a5f24; }
.op-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.op-btn {
  border: 1px solid #cdb489; border-radius: 8px; padding: 5px 3px; background: rgba(255, 252, 244, 0.8);
  text-align: center; color: #4a3a1a;
}
.op-btn b { display: block; font-size: 10.5px; font-family: var(--serif); }
.op-btn span { display: block; font-size: 8px; color: #8a7448; line-height: 1.15; margin-top: 1px; }
.op-btn.on { border-color: #b8862f; background: linear-gradient(180deg, #fff3d2, #ecd39a); box-shadow: inset 0 0 0 1px #b8862f; }
.op-note { margin: 4px 0 0; font-size: 9px; color: #7b6538; line-height: 1.35; }

/* 관아 — 포상 · 충성 */
.loyal-chip { font-style: normal; font-size: 8.5px; font-weight: 900; padding: 0 4px; border-radius: 4px; border: 1px solid #9dbb86; background: #eef6e0; color: #4f7a2c; }
.loyal-chip.mid { border-color: #d8bd82; background: #fbf1d8; color: #8a5f2a; }
.loyal-chip.low { border-color: #c98a80; background: #fbe6e2; color: #a8443a; }
.reward-row { display: flex; align-items: center; gap: 7px; padding: 5px 3px; border-bottom: 1px dashed rgba(150, 120, 60, 0.28); }
.reward-row img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
.reward-row .rw-main { flex: 1; min-width: 0; }
.reward-row .rw-main b { display: block; font-size: 12px; color: #2e2510; }
.reward-row .rw-main span { font-size: 9px; color: #7b6538; }
.reward-row button {
  flex: 0 0 auto; border: 1px solid #b8862f; border-radius: 7px; padding: 4px 7px;
  font-size: 9.5px; font-weight: 800; color: #6a4a10; background: linear-gradient(180deg, #ffe9ae, #ecc979);
}
.reward-row button:disabled { opacity: 0.45; }
.reward-row button.gift { border-color: #6a4a8a; color: #4a2f61; background: linear-gradient(180deg, #f1e4fb, #d9c2ec); }

/* 군량 상인 · 세율 */
.rice-quote {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  border: 1px solid #d8bd82; border-radius: 9px; padding: 7px 9px; margin-bottom: 7px;
  background: linear-gradient(180deg, #fffaf0, #f3e4c2);
}
.rice-quote .rq-main { min-width: 0; }
.rice-quote .rq-main b { display: block; font-family: var(--serif); font-size: 14px; color: #6a4a10; white-space: nowrap; }
.rice-quote .rq-main span { display: block; font-size: 8.5px; color: #7b6538; line-height: 1.3; margin-top: 1px; }
.rice-quote .rq-side { flex: 0 0 auto; text-align: right; }
.rice-quote .rq-side span { display: block; font-size: 8.5px; color: #8a7448; white-space: nowrap; }
.rice-quote .rq-side b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.rice-modes { display: flex; gap: 5px; margin-bottom: 7px; }
.rice-modes button {
  flex: 1; border: 1px solid #cdb489; border-radius: 8px; padding: 6px 2px;
  font-size: 11px; font-weight: 800; color: #4a3a1a; background: rgba(255, 252, 244, 0.85);
}
.rice-modes button.on { border-color: #b8862f; background: linear-gradient(180deg, #fff3d2, #ecd39a); box-shadow: inset 0 0 0 1px #b8862f; }
.rice-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rice-btns button {
  border: 1px solid #9dbb86; border-radius: 8px; padding: 8px 2px; font-size: 11px; font-weight: 800;
  color: #35521f; background: linear-gradient(180deg, #f2f9e6, #dfecc8); line-height: 1.25;
}
.rice-btns button small { display: block; font-size: 8.5px; font-weight: 700; color: #5f7a3a; }
.rice-btns button.sell { border-color: #d3a07a; color: #7a3f12; background: linear-gradient(180deg, #fdf1e2, #f0dcc2); }
.rice-btns button:disabled { opacity: 0.45; }
.tax-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 5px 0 3px; }
.tax-row button {
  border: 1px solid #cdb489; border-radius: 8px; padding: 5px 2px; text-align: center;
  font-size: 10.5px; font-weight: 800; color: #4a3a1a; background: rgba(255, 252, 244, 0.85);
}
.tax-row button small { display: block; font-size: 8px; font-weight: 700; color: #8a7448; margin-top: 1px; }
.tax-row button.on { border-color: #b8862f; background: linear-gradient(180deg, #fff3d2, #ecd39a); box-shadow: inset 0 0 0 1px #b8862f; }

/* 연병장 수련 명단 */
.crew-row { display: flex; align-items: center; gap: 7px; padding: 4px 3px; border-bottom: 1px dashed rgba(150, 120, 60, 0.28); }
.crew-row img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; }
.crew-row .cw-main { flex: 1; min-width: 0; }
.crew-row .cw-main b { display: block; font-size: 11.5px; color: #2e2510; }
.crew-row .cw-main span { font-size: 9px; color: #7b6538; }
.crew-row .cw-gain { flex: 0 0 auto; font-size: 9.5px; font-weight: 800; color: #4f7a2c; }
.crew-row button.onoff { flex: 0 0 auto; border: 1px solid #cdb489; border-radius: 7px; padding: 3px 7px; font-size: 9.5px; font-weight: 800; color: #6a4a10; background: #f6ead0; }
.crew-row button.onoff.on { border-color: #47673c; background: #e8f3d6; color: #35521f; }
/* v5.33 — 장수 전출 복수 선택 */
/* 긴 명단은 창 안에서만 스크롤 — [N명 이동] 버튼이 화면 밖으로 밀리지 않게 */
#tr-list { max-height: 44vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding-right: 2px; }
.tr-bar { display: flex; align-items: center; gap: 4px; margin: 2px 0 6px; }
.tr-mini {
  border: 1px solid #cdb489; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 800;
  color: #6a4a10; background: #f6ead0;
}
.tr-mini:active { transform: scale(0.96); }
.tr-count { margin-left: auto; font-size: 10px; font-weight: 900; color: #8a5a1a; }
.crew-row.sel { background: #f2f7e6; box-shadow: inset 0 0 0 1px #47673c; border-radius: 7px; }
.crew-row[data-locked="1"] { opacity: 0.5; }
.crew-row button.onoff[disabled] { opacity: 0.5; }
.btn-primary.off { filter: grayscale(0.6); opacity: 0.55; }

/* 월정산 — AI 세력 소식 · 침공 경고 */
.mr-ai { margin-top: 6px; border-top: 1px dashed rgba(150, 120, 60, 0.35); padding-top: 5px; }
.mr-ai-title { margin: 0 0 3px; font-size: 10px; font-weight: 900; color: #7a5417; }
.mr-ai-row { display: flex; gap: 5px; font-size: 9.5px; color: #4a3a1a; line-height: 1.35; padding: 1px 0; }
.mr-ai-row em { font-style: normal; flex: 0 0 auto; }
.invasion-card {
  border: 1.5px solid #a8443a; border-radius: 10px; padding: 9px; background: linear-gradient(180deg, #fbeee8, #f3dcd2);
}
.invasion-card h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 14px; color: #7a2a20; }
.invasion-card p { margin: 0 0 4px; font-size: 10px; color: #4a3a1a; line-height: 1.4; }
.invasion-nums { display: flex; gap: 6px; flex-wrap: wrap; margin: 5px 0; }
.invasion-nums span { font-size: 9.5px; color: #4a3a1a; background: #fff8ee; border: 1px solid #d8bd82; border-radius: 6px; padding: 2px 6px; }
.invasion-nums b { font-size: 11px; color: #7a2a20; }
/* v5.7.1 — 사신 줄: 담당 장수도 보낼 수 있다는 표시 */
.ev-chip .ev-duty {
  font-style: normal; font-size: 7.5px; font-weight: 900; letter-spacing: -0.02em;
  padding: 0 3px; border-radius: 3px; color: #7a3f12;
  background: #fbe6cf; border: 1px solid #d3a07a;
}
/* v5.7 — 포상 창 충성 한 줄 평 */
.reward-row .rw-main span { display: block; }
.reward-row .rw-main .rw-note { display: block; font-style: normal; font-size: 8.5px; color: #6f8a4a; line-height: 1.25; }
.reward-row .rw-main .rw-note.mid { color: #8a6a2a; }
.reward-row .rw-main .rw-note.low { color: #a8443a; }

/* ══════════════════════════════════════════════════════════════
   v5.8 — 외교·포로·관직·돌발이벤트·입문가이드·난이도
   ══════════════════════════════════════════════════════════════ */

/* ── 난이도 선택 (세력 화면) ── */
.fx-diff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px 6px; }
.fd-btn {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 4px 6px; border-radius: 6px;
  border: 1.5px solid #b3903f; color: var(--ink);
  background: linear-gradient(180deg, #f5e8c9, #e5d0a5);
  box-shadow: inset 0 1px 0 rgba(255, 250, 235, 0.6);
}
.fd-btn b { font-size: 13px; letter-spacing: -0.02em; }
.fd-btn span { font-size: 9.5px; line-height: 1.25; color: var(--ink-soft); letter-spacing: -0.03em; }
.fd-btn.on {
  border-color: #6d4c14; color: #fff6df;
  background: linear-gradient(180deg, #7b5c25, #55401a);
  box-shadow: inset 0 1px 0 rgba(255, 232, 168, 0.45), 0 3px 8px rgba(0, 0, 0, 0.35);
}
.fd-btn.on span { color: #f0dcac; }
.fx-reco {
  position: absolute; left: -6px; top: -7px; z-index: 2;
  padding: 2px 5px; border-radius: 4px; font-size: 8.5px; font-weight: 900; letter-spacing: -0.03em;
  color: #3a2a08; background: linear-gradient(180deg, #ffe6a1, #e8bd5c);
  border: 1px solid #8a6417; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); white-space: nowrap;
}
.fx-card.reco { border-color: #d9a83f; box-shadow: inset 0 0 0 1px rgba(255, 243, 208, 0.6), 0 0 0 1.5px rgba(227, 189, 99, 0.55), 0 5px 12px rgba(0, 0, 0, 0.44); }

/* ── 책사 첫걸음 배너 ── */
.city-guide {
  position: relative; flex: 0 0 auto; display: flex; align-items: flex-start; gap: 6px;
  margin: 5px 8px 0; padding: 7px 30px 7px 8px; border-radius: 7px;
  border: 1.5px solid #b3903f; color: var(--ink);
  background: linear-gradient(180deg, #fdf3d8, #f0e0b6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 3px 8px rgba(40, 30, 10, 0.25);
}
.city-guide[hidden] { display: none; }
.cg-badge {
  flex: 0 0 auto; padding: 2px 5px; border-radius: 4px; font-size: 9px; font-weight: 900;
  color: #fff6df; background: linear-gradient(180deg, #6b8a52, #46603a); border: 1px solid #2f4728;
  white-space: nowrap;
}
.cg-text { margin: 0; font-size: 10.5px; line-height: 1.45; letter-spacing: -0.03em; }
.cg-text b { color: #7d4a12; }
.cg-close {
  position: absolute; right: 5px; top: 4px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 1px solid #b3903f; background: #f7ecd4; color: #6b5c3d;
  font-size: 13px; line-height: 1; font-weight: 900;
}

/* ── ? 도움말 ── */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; margin-left: 3px; padding: 0; border-radius: 50%;
  border: 1px solid #9a7a34; background: #fff7e2; color: #7d5a1d;
  font-size: 9px; font-weight: 900; line-height: 1; vertical-align: middle;
}
.help-tip p { margin: 0 0 7px; font-size: 13px; line-height: 1.55; letter-spacing: -0.02em; }
.help-tip p:last-child { margin-bottom: 0; }

/* ── 이간계 — 적장 충성 막대 ── */
.estr-bar { position: relative; display: block; height: 9px; margin-top: 3px; border-radius: 5px; background: rgba(90, 70, 40, 0.18); overflow: hidden; }
.estr-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a8443a, #d98a63); }
.estr-bar em { position: relative; z-index: 1; display: block; font-size: 8px; line-height: 9px; text-align: center; color: #2b2416; font-weight: 900; }
.lure-card { display: flex; gap: 10px; align-items: flex-start; }
.lure-card img { width: 72px; height: 88px; object-fit: cover; border-radius: 6px; border: 2px solid #b8862f; }
.lure-card b { font-size: 16px; }
.lure-card span { display: block; font-size: 11px; color: var(--ink-soft); }
.lure-card p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; }
.surr-card { display: flex; gap: 10px; align-items: flex-start; }
.surr-seal {
  flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 6px;
  font-family: var(--serif); font-size: 24px; font-weight: 900; color: #fff3d6;
  background: linear-gradient(180deg, #a8443a, #7c2b23); border: 1.5px solid #5c1d16;
}
.surr-card b { font-size: 15px; }
.surr-card p { margin: 5px 0; font-size: 12.5px; line-height: 1.5; }
.surr-card em { font-size: 11px; color: #47673c; font-weight: 700; }
/* ── v5.61 외교·계략 결과 — 전후 수치 ── */
.scheme-result { display: flex; flex-direction: column; gap: 7px; }
.sr-head { margin: 0; font-size: 11.5px; font-weight: 800; color: #5a4a26; line-height: 1.45; }
.sr-rows { display: flex; flex-direction: column; gap: 4px; }
.sr-rows > div { display: flex; align-items: baseline; gap: 5px; padding: 5px 8px; border-radius: 7px; background: #f8efd9; border: 1px solid #e0cda0; font-size: 11.5px; }
.sr-rows span { flex: 1; min-width: 0; font-weight: 800; color: #6b5324; }
.sr-rows b { font-weight: 700; color: #8a7448; font-variant-numeric: tabular-nums; }
.sr-rows i { font-style: normal; color: #b09a6a; }
.sr-rows strong { font-weight: 900; color: #2e2510; font-variant-numeric: tabular-nums; }
.sr-rows em { font-style: normal; font-weight: 900; font-size: 10.5px; color: #a8443a; font-variant-numeric: tabular-nums; }
.sr-rows em.up { color: #2f6b45; }
.sr-rows em.flat { color: #8a7448; }
.sr-note { margin: 0; font-size: 10.5px; line-height: 1.5; color: #7b6538; }
/* ── v5.61 세력 멸망 배너 ── */
.rm-fall-banner { margin: 0 0 10px; padding: 8px 10px; border-radius: 9px; border: 1.5px solid #c08a2a; text-align: center; color: #4a3208; background: linear-gradient(180deg, #fff4d2, #f2d68b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 3px 9px rgba(60, 40, 8, 0.28); }
.rm-fall-banner b { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: -0.02em; }
.rm-fall-banner span { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 700; line-height: 1.45; color: #7a5b18; }

/* ── 관직 ── */
.ap-list { display: flex; flex-direction: column; gap: 5px; max-height: 54vh; overflow-y: auto; }
.ap-row {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 6px; text-align: left;
  border: 1px solid #c2a367; background: linear-gradient(180deg, #f9eed6, #efdfbb); color: var(--ink);
}
.ap-row.on { border-color: #6d4c14; box-shadow: inset 0 0 0 1px rgba(184, 134, 47, 0.55); }
.ap-row img { width: 34px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid #b3903f; }
.ap-row > div { flex: 1 1 auto; min-width: 0; }
.ap-row b { display: block; font-size: 13px; }
.ap-row span { display: block; font-size: 9.5px; color: var(--ink-soft); letter-spacing: -0.03em; }
.ap-office { flex: 0 0 auto; font-size: 10px; font-weight: 900; color: #7d4a12; }
.ap-cap { flex: 0 0 auto; font-size: 10px; color: var(--ink-soft); }
.ap-cap b { display: inline; font-size: 11px; color: #2b2416; }
.ap-picks { display: flex; flex-direction: column; gap: 5px; }
.ap-pick {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 6px; text-align: left;
  border: 1px solid #c2a367; background: linear-gradient(180deg, #f9eed6, #efdfbb); color: var(--ink);
}
.ap-pick b { font-size: 13px; }
.ap-pick span { font-size: 10px; color: var(--ink-soft); }
.ap-pick em { font-size: 10px; color: #5b4a28; }
.ap-pick.on { border-color: #6d4c14; background: linear-gradient(180deg, #f3dfa9, #e6cd93); }
.ap-pick[disabled] { opacity: 0.45; }
.ap-pick:not([disabled]):active { transform: translateY(1px); }

/* ── 돌발 선택지 이벤트 ── */
.choice-card { position: relative; padding-left: 4px; }
.cc-seal {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px;
  border-radius: 5px; font-family: var(--serif); font-size: 19px; font-weight: 900; color: #fff3d6;
  background: linear-gradient(180deg, #7b5c25, #55401a); border: 1.5px solid #3a2a08;
}
.cc-text { margin: 0 0 9px; font-size: 13px; line-height: 1.55; letter-spacing: -0.02em; }
.cc-opts { display: flex; flex-direction: column; gap: 6px; }
.cc-opt {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 7px; text-align: left;
  border: 1.5px solid #b3903f; background: linear-gradient(180deg, #fbf0d8, #eedcb6); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.cc-opt b { font-size: 13.5px; letter-spacing: -0.02em; }
.cc-opt span { font-size: 10.5px; color: var(--ink-soft); letter-spacing: -0.02em; }
.cc-opt:not([disabled]):active { transform: translateY(1px); filter: brightness(0.97); }
.cc-opt[disabled] { opacity: 0.45; }

/* ── 전투 후 포로 ── */
.rm-prisoners { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 6px 0; padding: 5px 7px; border-radius: 6px; background: rgba(168, 68, 58, 0.1); border: 1px solid rgba(168, 68, 58, 0.35); }
.rp-tag { font-size: 10px; font-weight: 900; color: #7c2b23; }
.rm-prisoners img { width: 26px; height: 32px; object-fit: cover; border-radius: 3px; border: 1px solid #a8443a; }
.rm-prisoners em { font-size: 9.5px; color: var(--ink-soft); }
.prison-card { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.prison-port { width: 84px; height: 104px; object-fit: cover; border-radius: 6px; border: 2px solid #a8443a; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.prison-main { flex: 1 1 auto; min-width: 0; }
.prison-main b { display: block; font-size: 16px; }
.prison-main span { display: block; font-size: 11px; color: var(--ink-soft); }
.prison-main p { margin: 5px 0 0; font-size: 11.5px; line-height: 1.45; }
.prison-loy { position: relative; display: block; height: 11px; margin: 5px 0 0; border-radius: 6px; background: rgba(90, 70, 40, 0.18); overflow: hidden; }
.prison-loy i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a8443a, #d98a63); }
.prison-loy em { position: relative; z-index: 1; display: block; font-size: 8.5px; line-height: 11px; text-align: center; font-weight: 900; }
.prison-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prison-opt {
  display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 8px 3px; border-radius: 7px;
  border: 1.5px solid #b3903f; color: var(--ink); background: linear-gradient(180deg, #fbf0d8, #eedcb6);
}
.prison-opt b { font-size: 13px; }
.prison-opt span { font-size: 9px; color: var(--ink-soft); text-align: center; line-height: 1.25; letter-spacing: -0.04em; }
.prison-opt.hire { border-color: #47673c; background: linear-gradient(180deg, #eaf3dc, #d6e6c4); }
.prison-opt.kill { border-color: #a8443a; background: linear-gradient(180deg, #f8e3de, #efcbc3); }
.prison-opt:active { transform: translateY(1px); filter: brightness(0.96); }
.prison-log p { margin: 0 0 7px; font-size: 12.5px; line-height: 1.5; }
.ex-duty { display: block; margin-top: 5px; font-size: 10px; color: var(--ink-soft); }

/* ══════════════════════════════════════════════════════════════════════
   v5.9 시안 A — 성 화면 전면 리뉴얼
   · 성 그림 위에는 1줄 건물 이름표만 (얼굴 스티커·이중 Lv 배지 제거)
   · 그림 아래 [내정] · [시설] · [장수] 3단 탭
   · 내정 = 2열 막대 카드 + 성 요약 / 시설 = 2열 건물 카드 / 장수 = 관직 배지 카드
   ══════════════════════════════════════════════════════════════════════ */

/* ── 성 그림: 높이를 잡아 주고 이름표만 남긴다 ── */
.city-mid > .city-scene { flex: 0 0 auto; height: clamp(176px, 31vh, 288px); min-height: 0; }
.city-scene .scene-shade { background: linear-gradient(180deg, rgba(40, 30, 12, 0.22) 0%, transparent 20%, transparent 74%, rgba(40, 30, 12, 0.3) 100%); }
.hs-pin {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  padding: 0; border: 0; background: none; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(12, 8, 2, 0.55));
}
.hs-pin .hs-name {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 8px 3px; border-radius: 4px;
  font-family: var(--serif); font-size: 10px; font-weight: 800; letter-spacing: 0.03em;
  color: #ffeec4; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
  background:
    repeating-linear-gradient(90deg, rgba(255, 222, 160, 0.05) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(74, 52, 22, 0.94) 0%, rgba(44, 30, 12, 0.94) 100%);
  border: 1px solid rgba(214, 175, 92, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.28), 0 2px 5px rgba(8, 5, 1, 0.45);
  transition: transform 0.12s ease, background 0.12s ease;
}
.hs-pin.office .hs-name {
  font-size: 11px; padding: 2px 10px 3px;
  background: linear-gradient(180deg, rgba(96, 62, 22, 0.96), rgba(56, 34, 10, 0.96));
  border-color: #e8c476;
}
.hs-pin.empty .hs-name {
  font-size: 8.5px; padding: 1px 6px 2px; font-weight: 700;
  color: #fff3cf;
  background: rgba(48, 35, 15, 0.55); border: 1px dashed rgba(240, 212, 150, 0.85);
  box-shadow: none;
}
.hs-pin.empty .hs-plus { font-size: 10px; font-weight: 900; color: #f4dca6; }
.hs-pin:active .hs-name { transform: scale(0.94); background: linear-gradient(180deg, #6b4c1e, #3d2910); }
.hs-pin.bump .hs-name { animation: hsBump 0.5s ease; }
@keyframes hsBump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.16); box-shadow: 0 0 0 6px rgba(255, 236, 170, 0.22); } }

/* ── 3단 탭 ── */
.city-tabs {
  position: sticky; top: 0; z-index: 6; flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  padding: 0 8px 6px; margin-top: -1px;
  background: linear-gradient(180deg, #efe0bf 0%, #f4e8c9 40%, #f4e8c9 100%);
  border-bottom: 1px solid rgba(184, 134, 47, 0.45);
  box-shadow: 0 3px 8px rgba(90, 70, 30, 0.14);
}
.ct-tab {
  position: relative; border: 1px solid #cdb083; border-left-width: 0;
  background: linear-gradient(180deg, rgba(255, 250, 236, 0.92), rgba(236, 219, 183, 0.92));
  color: #6d5729; font-family: var(--serif); font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
  padding: 8px 0 7px; display: flex; align-items: center; justify-content: center; gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 0.16s ease, color 0.16s ease;
}
.ct-tab:first-child { border-left-width: 1px; border-radius: 9px 0 0 9px; }
.ct-tab:last-child { border-radius: 0 9px 9px 0; }
.ct-tab em {
  font-family: var(--sans); font-style: normal; font-size: 8.5px; font-weight: 800;
  color: #8a7448; background: rgba(255, 255, 255, 0.55); border-radius: 7px; padding: 0 4px; line-height: 12px;
}
.ct-tab.on {
  color: #fff8e6; z-index: 1;
  background: linear-gradient(180deg, #d5ae62 0%, #bd9440 52%, #a87e2c 100%);
  border-color: #8a6420;
  box-shadow: inset 0 1px 0 rgba(255, 246, 214, 0.6), inset 0 -2px 6px rgba(90, 60, 14, 0.35), 0 2px 6px rgba(90, 66, 22, 0.28);
  text-shadow: 0 1px 1px rgba(84, 56, 12, 0.6);
}
.ct-tab.on em { color: #5c421a; background: rgba(255, 246, 214, 0.8); }
.ct-tab:active { filter: brightness(0.97); }

.city-panes { flex: 0 0 auto; display: block; }
.city-pane { display: none; }
.city-pane.on { display: block; animation: paneIn 0.22s ease; }
@keyframes paneIn { from { opacity: 0.4; transform: translateY(4px); } }

/* ── 내정 탭: 2열 막대 카드 ── */
.city-dev { padding: 7px 9px 8px; border-top: 0; }
.city-dev::before { display: none; }
.city-dev .dev-head { gap: 6px; margin-bottom: 6px; }
.city-dev .dev-lv { font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.city-dev .dev-name { font-size: 11.5px; letter-spacing: 0.01em; }
.dev-note { margin-left: auto; font-size: 8.5px; color: #9a8759; letter-spacing: -0.02em; }
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dev-card {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 6px 8px 6px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.95), rgba(244, 232, 206, 0.95));
  border: 1px solid #d8c193;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.1);
}
.dev-card.warn { border-color: #c98a78; background: linear-gradient(180deg, #fdf1ea, #f5ded2); }
.dc-ic {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 2px; border-radius: 7px;
  background: radial-gradient(circle at 50% 36%, #fffdf4, #efe0bf);
  border: 1px solid rgba(184, 134, 47, 0.45);
}
.dc-main { flex: 1; min-width: 0; }
.dc-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dc-label { display: inline-flex; align-items: center; gap: 2px; font-size: 9.5px; font-weight: 700; color: #7d6739; white-space: nowrap; letter-spacing: -0.02em; }
.dc-label .help-dot { width: 11px; height: 11px; font-size: 8px; margin-left: 1px; flex: 0 0 auto; }
.dc-val { margin-left: auto; font-family: var(--serif); font-size: 13.5px; color: #2f240e; letter-spacing: -0.02em; line-height: 1; }
.dc-delta { font-size: 8px; font-weight: 800; color: #4f7a2c; white-space: nowrap; }
.dc-delta.down { color: #a8443a; }
.dc-bar { display: block; height: 4px; margin-top: 4px; border-radius: 3px; background: #e0cda6; overflow: hidden; box-shadow: inset 0 1px 1px rgba(90, 70, 30, 0.18); }
.dc-bar em { display: block; height: 100%; border-radius: 3px; transition: width 0.35s ease; }

/* ── 내정 탭: 성 요약 카드 ── */
.city-info {
  display: block; padding: 0 9px 10px; background: none; border-top: 0;
}
.ci-head { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 5px; }
.ci-head b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.ci-head span { font-size: 8.5px; color: #9a8759; }
.ci-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  padding: 4px 3px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.96), rgba(243, 230, 202, 0.96));
  border: 1px solid #d8c193;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.1);
}
.ci-cell {
  position: relative; display: flex; align-items: baseline; gap: 5px; min-width: 0;
  padding: 5px 6px; border-radius: 7px;
}
.ci-cell + .ci-cell { border-left: 1px dotted rgba(160, 130, 70, 0.25); }
.ci-cell:nth-child(odd) { border-left: 0; }
.ci-cell:nth-child(n+3) { border-top: 1px dotted rgba(160, 130, 70, 0.22); }
/* v5.56 — 훈련도 옆 전장 보정 (+6.0%) */
.ci-cell .ci-train-pct { font-style: normal; font-size: 8.5px; font-weight: 800; color: #8a6a34; margin-left: 3px; }
.ci-cell > span { display: inline-flex; align-items: center; gap: 2px; font-size: 9px; color: #7d6739; white-space: nowrap; letter-spacing: -0.02em; }
.ci-cell > span .help-dot { width: 11px; height: 11px; font-size: 8px; flex: 0 0 auto; }
.ci-cell > b { margin-left: auto; font-family: var(--serif); font-size: 12px; color: #2f240e; letter-spacing: -0.02em; white-space: nowrap; }
.ci-cell > b.full { color: #a8443a; }
.ci-cell > b.minus { color: #9a6a2a; }
.ci-cell > em { font-size: 7.5px; color: #a08b5e; white-space: nowrap; letter-spacing: -0.03em; }
.ci-cell.wound.on { background: rgba(214, 160, 140, 0.16); }
.ci-cell.wound.on > b { color: #a8443a; }
.ci-heal {
  flex: 0 0 auto; padding: 0 5px; height: 15px; border-radius: 8px; margin-left: 3px;
  border: 1px solid #b06a52; background: linear-gradient(180deg, #f6e2d6, #e7c3b1);
  font-size: 8px; font-weight: 800; color: #7c2b23; line-height: 13px;
}

/* ── 시설 탭: 2열 건물 카드 ── */
.city-slots { padding: 7px 9px 10px; border-top: 0; }
.city-slots .slot-head { align-items: center; gap: 6px; padding: 0 2px 6px; }
.city-slots .slot-head b { font-size: 11.5px; }
.city-slots .slot-head span { font-size: 8.5px; color: #9a8759; }
.slot-upall {
  margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px;
  padding: 3px 8px; border-radius: 9px; border: 1px solid #7d5a1d;
  background: linear-gradient(180deg, #5f7a44, #3d5730); color: #f4e9c8;
  font-size: 9.5px; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.28), 0 2px 6px rgba(40, 50, 26, 0.28);
}
.slot-upall em { font-size: 8px; font-weight: 700; color: #dfe8c8; }
.slot-upall:active { transform: translateY(1px); }
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot-grid .slot-card {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 6px;
  border-radius: 10px; border: 1px solid #d8c193; text-align: left;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.96), rgba(243, 230, 202, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.12);
}
.slot-grid .slot-card:active { transform: translateY(1px); }
.slot-grid .slot-card.ready { border-color: #c3a15a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1px rgba(201, 162, 78, 0.35), 0 2px 6px rgba(96, 74, 34, 0.14); }
.slot-grid .sc-ico { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(60, 44, 16, 0.25)); }
.slot-grid .sc-main { flex: 1; min-width: 0; }
.sc-top { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.sc-top b { font-family: var(--serif); font-size: 11.5px; color: #2f240e; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-top em { margin-left: auto; font-size: 9px; font-weight: 800; color: #8a6a26; white-space: nowrap; }
.slot-grid .sc-exp { display: block; height: 4px; margin: 3px 0 3px; border-radius: 3px; background: #e0cda6; overflow: hidden; }
.slot-grid .sc-exp i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #6f9a4a, #a8cf72); }
.slot-grid .sc-exp.full i { background: linear-gradient(90deg, #d0a02a, #f2cf6a); }
.sc-owner { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; font-size: 8px; color: #7d6739; min-width: 0; }
.sc-owner em { min-width: 0; max-width: 100%; font-size: 7.5px; color: #a3906a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v5.41 — 담당·부장·배속 배지가 한 줄에 몰려 '수입 50'처럼 잘리지 않게 줄바꿈을 허용한다 */
.sc-owner .sc-dep, .sc-owner .sc-dep-empty, .sc-owner .sc-need, .sc-owner .sc-up { flex: 0 0 auto; }
.sc-owner .sc-face { width: 12px; height: 12px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid #c9a24e; }
.sc-up { margin-left: auto; font-size: 7.5px; font-weight: 900; color: #8a5f1d; background: #f6e2b0; border: 1px solid #c9a24e; border-radius: 6px; padding: 0 3px; white-space: nowrap; }
/* v5.40 — 배속 배지는 .sc-up과 같은 알약 모양. (규칙이 없어 '배/속'이 두 줄로 쪼개져 카드 밖으로 넘쳤다) */
.sc-need { margin-left: auto; flex: 0 0 auto; font-size: 7.5px; font-weight: 900; color: #7a4f3a; background: #fbe6cf;
  border: 1px solid #d3a074; border-radius: 6px; padding: 0 3px; white-space: nowrap; line-height: 1.35; }
/* v5.40 — 250종의 갈래 칩 8개는 가로 스크롤 대신 두 줄로 접어 모두 보이게 */
.cdx-filters > div.cdx-types { flex-wrap: wrap; overflow-x: visible; }
/* v5.39에서 남아 있던 '담당이 빈 건물 N곳' 안내가 본문 크기로 커져 화면을 덮었다 */
.slot-hint { margin: 2px 0 5px; font-size: 9.5px; line-height: 1.45; color: #8a6a2e; }
.slot-hint b { font-size: inherit; color: #6f4f14; }
/* v5.40 — 공방 제작·성벽 방첩 배지·상세 창 */
.sc-top .sc-craft { font-style: normal; font-size: 7px; font-weight: 900; color: #5f6f45; background: #eef2dc;
  border: 1px solid #b7c48e; border-radius: 5px; padding: 0 3px; white-space: nowrap; margin-left: 2px; }
/* v5.41 — 첩보소가 살필 이웃 성이 없을 때 */
.sc-top .sc-craft.warn { color: #8a3a2a; background: #f9e0d6; border-color: #d3a074; }
.ws-craft { margin: 6px 0 2px; padding: 6px 8px; border-radius: 8px; background: rgba(246, 238, 218, 0.8);
  border: 1px dashed rgba(150, 120, 60, 0.45); }
.wc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.wc-head b { font-size: 10px; color: #4a3a1a; }
.wc-head span { font-size: 9px; font-weight: 900; color: #7a5a1c; }
.wc-bar { height: 5px; border-radius: 3px; background: #d8c8a2; overflow: hidden; margin: 3px 0 2px; }
.wc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c9a24e, #8f6f28); }
.ws-craft p { margin: 2px 0 0; font-size: 8.5px; line-height: 1.4; color: #6d5a30; }
/* v5.40 — 선택한 부대가 없을 때 하단 카드는 초상·수치를 남기지 않고 안내만 */
.unit-card.empty .uc-portrait { display: none; }
.unit-card.empty .uc-bars, .unit-card.empty .uc-meta, .unit-card.empty .uc-stats { display: none; }
.unit-card.empty .uc-row { gap: 6px; }
.unit-card.empty #uc-name { font-size: 12px; color: #6d5a30; }
.unit-card.empty #uc-cls { font-size: 9.5px; color: #8a7448; }
.slot-grid .slot-card.empty {
  border-style: dashed; border-color: #c9ae7c; align-items: center; justify-content: center; gap: 6px;
  background: rgba(252, 246, 232, 0.55); min-height: 62px;
}
.sc-plus { font-size: 19px; font-weight: 900; color: #b09050; line-height: 1; }
.sc-empty-main { display: flex; flex-direction: column; }
.sc-empty-main b { font-size: 10px; color: #8a7448; }
.sc-empty-main small { font-size: 7.5px; color: #a3906a; }
.slot-note { margin: 7px 2px 0; font-size: 8px; color: #a3906a; line-height: 1.4; letter-spacing: -0.02em; }

/* ── 장수 탭: 상태 요약 + 관직 배지 카드 ── */
.city-ap { padding: 7px 9px 6px; border-top: 0; background: none; }
.ap-head { gap: 6px; }
.ap-head .ap-title { font-size: 10px; letter-spacing: 0.02em; color: #6b5830; }
.ap-head .ap-dots { margin: 0 0 0 4px; gap: 3px; align-items: center; flex-wrap: wrap; }
.ap-dots em { display: inline-flex; align-items: center; font-size: 8.5px; font-weight: 700; color: #7d6739; margin-right: 3px; white-space: nowrap; }
.ap-dots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.ap-dots i.duty { background: #4e8b3c; }
.ap-dots i.ready { background: #c9a24e; }
.ap-dots i.spent { background: #cbbfa4; }
.ap-best {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 9px; border: 1px solid #c9ae7c;
  background: rgba(255, 252, 243, 0.85); color: #7d6739; font-size: 9px; font-weight: 800; letter-spacing: -0.02em;
}
.ap-best i { width: 8px; height: 8px; border-radius: 50%; background: #c9bfa6; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); }
.ap-best.on { border-color: #6f8f52; background: #f0f6e4; color: #3f5f2e; }
.ap-best.on i { background: #5f8b3c; box-shadow: 0 0 5px rgba(95, 139, 60, 0.7); }
.ap-row2 { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.ap-row2 .ap-actor { margin-left: 0; font-size: 9px; }
.ap-delegate, .ap-auto {
  display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px; border-radius: 10px;
  font-size: 9.5px; font-weight: 800; letter-spacing: -0.02em;
}
.ap-delegate { border: 1px solid #b99a5e; background: linear-gradient(180deg, #fbf1db, #ecdcb8); color: #5b4a26; }
.ap-delegate span { color: #8a6a26; font-weight: 900; }
.ap-auto { margin-left: auto; border: 1px solid #7d5a1d; background: linear-gradient(180deg, #5f7a44, #3d5730); color: #f4e9c8; box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.28); }
.ap-auto span { font-weight: 900; }
.ap-auto.dim { opacity: 0.5; }

.city-general-strip { display: block; overflow: visible; padding: 0 9px 10px; background: none; min-height: 0; }
.gl-head { display: flex; align-items: center; gap: 6px; padding: 4px 2px 5px; }
.gl-head b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.gl-head b em { font-size: 8.5px; color: #8a7448; font-style: normal; margin-left: 2px; }
.gl-all {
  margin-left: auto; padding: 2px 8px; border-radius: 9px; border: 1px solid #c9ae7c;
  background: rgba(255, 252, 243, 0.9); font-size: 9px; font-weight: 800; color: #7a5f24;
}
.gen-list { display: flex; flex-direction: column; gap: 5px; }
.gen-card {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px 6px 6px;
  border-radius: 10px; border: 1px solid #d8c193;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.96), rgba(243, 230, 202, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.gen-card:active { transform: translateY(1px); }
.gen-card.duty { border-color: #bfa267; }
.gen-card.done { opacity: 0.62; filter: grayscale(0.5); }
.gen-card.sel { border-color: #3f6fb5; box-shadow: 0 0 0 2px rgba(63, 111, 181, 0.18), 0 2px 6px rgba(90, 70, 30, 0.14); }
.gc-pt { position: relative; flex: 0 0 auto; width: 40px; height: 46px; border-radius: 8px; overflow: hidden; border: 1.5px solid #c9a24e; background: #efe0bf; }
.gc-pt img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
.gc-lv {
  position: absolute; left: 1px; bottom: 1px; padding: 0 3px; border-radius: 5px;
  font-size: 7.5px; font-weight: 900; color: #fff6e2; line-height: 12px;
  background: rgba(46, 32, 12, 0.86); border: 1px solid rgba(227, 189, 99, 0.6);
}
.gc-body { flex: 1; min-width: 0; display: block; }
.gc-line1 { display: flex; align-items: center; gap: 4px; min-width: 0; }
.gc-name { font-family: var(--serif); font-size: 13px; color: #2f240e; letter-spacing: -0.01em; line-height: 1.15; }
.gc-age { font-size: 8px; color: #a08b5e; white-space: nowrap; }
.gc-off {
  padding: 0 5px; border-radius: 6px; font-size: 7.5px; font-weight: 900; letter-spacing: -0.02em;
  color: #6b4a12; background: linear-gradient(180deg, #f7e3ae, #e5c273); border: 1px solid #c9a24e; line-height: 13px; white-space: nowrap;
}
.gc-flag {
  margin-left: auto; padding: 0 6px; border-radius: 8px; font-size: 7.5px; font-weight: 900; line-height: 14px;
  white-space: nowrap; border: 1px solid transparent;
}
.gc-flag.ready { color: #7a5f24; background: #f6ecd4; border-color: #dcc79b; }
.gc-flag.duty { color: #3f7a3c; background: #eef6e2; border-color: #b7c49a; }
.gc-flag.train { color: #2c5f86; background: #e6f0f7; border-color: #a9c4d6; }
.gc-flag.done { color: #8a7448; background: #efe6d2; border-color: #d3bb8a; }
.gc-line2 { display: block; font-size: 8.5px; color: #7d6739; margin-top: 1px; letter-spacing: -0.02em; }
.gc-nums { display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: nowrap; overflow: hidden; }
.gc-nums i { font-style: normal; font-size: 7.5px; color: #9a8759; letter-spacing: -0.02em; white-space: nowrap; }
.gc-nums i b { font-family: var(--serif); font-size: 9.5px; color: #463817; font-weight: 800; margin-left: 1px; }
.gc-nums i.loy { margin-left: auto; color: #8a6a26; }
.gc-nums i.loy b { color: #7a5a12; }
.empty-gens { font-size: 10px; color: #8a7648; margin: 6px 2px; }

/* ── 모달: 부상병 치료 · 지원군 ── */
.wound-card .wc-num { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #f8ece0; border: 1px solid #ddbaa6; }
.wound-card .wc-ic { width: 24px; height: 24px; }
.wound-card .wc-num b { font-family: var(--serif); font-size: 20px; color: #a8443a; }
.wound-card .wc-num span { font-size: 10px; color: #8a6a4a; }
.wound-card p { margin: 8px 0; font-size: 12px; line-height: 1.5; }
.wound-card .wc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.wound-card .wc-rows div { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: #6b5830; }
.wound-card .wc-rows b { color: #2f240e; }
.wound-card .wc-rows b.minus { color: #a8443a; }

.rfg-list { display: flex; flex-direction: column; gap: 6px; }
.rfg-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 10px; border: 1px solid #d3bb8a;
  background: linear-gradient(180deg, #fffaf0, #f4e5c4);
}
.rfg-row:active { transform: translateY(1px); }
.rr-flag { flex: 0 0 auto; padding: 1px 6px; border-radius: 7px; font-size: 9px; font-weight: 800; color: #fff6df; background: linear-gradient(180deg, #6b8a52, #46603a); border: 1px solid #2f4728; }
.rr-main { flex: 1; min-width: 0; }
.rr-main b { display: block; font-family: var(--serif); font-size: 14px; color: #2f240e; }
.rr-main em { font-size: 10px; color: #7d6739; }
.rr-go { color: #8a6a26; font-size: 14px; }
.rfg-tip, .rfg-ready {
  display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 7px 9px; border-radius: 9px;
  border: 1px dashed #c9a24e; background: rgba(247, 236, 212, 0.7);
}
.rfg-tip b, .rfg-ready b { font-size: 11px; color: #7a5a12; }
.rfg-tip span, .rfg-ready span { font-size: 9.5px; color: #8a7448; }
.rfg-ready { border-style: solid; border-color: #7fa062; background: #f1f7e4; }
.rfg-ready b { color: #3f5f2e; }
.rfg-pick .rp-head { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 6px; }
.rfg-pick .rp-head b { font-size: 12px; color: #4a3a1a; }
.rfg-pick .rp-head em { font-size: 9px; color: #9a8a66; }
.rp-gens { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.rp-gens::-webkit-scrollbar { display: none; }
.rp-gen {
  flex: 0 0 auto; position: relative; width: 74px; padding: 4px; border-radius: 9px;
  border: 1.5px solid #d3bb8a; background: rgba(255, 252, 244, 0.9); text-align: center;
}
.rp-gen.on { border-color: #3f6fb5; background: #eef4ff; box-shadow: 0 0 0 2px rgba(63, 111, 181, 0.16); }
.rp-gen img { width: 100%; height: 58px; object-fit: cover; object-position: 50% 14%; border-radius: 6px; display: block; }
.rp-main { display: block; text-align: left; margin-top: 3px; }
.rp-main b { display: block; font-family: var(--serif); font-size: 11px; color: #2f240e; }
.rp-main em { font-size: 8px; color: #7d6739; display: block; }
.rp-main i { font-style: normal; font-size: 7.5px; color: #9a8759; }
.rp-tick { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 900; color: #fff6e2; background: rgba(46, 32, 12, 0.62); }
.rp-gen.on .rp-tick { background: #3f6fb5; }
.rp-troops { margin: 4px 0 6px; }
.rp-row { display: flex; align-items: baseline; gap: 5px; }
.rp-row span { font-size: 11px; color: #6b5830; }
.rp-row b { font-family: var(--serif); font-size: 15px; color: #2f240e; }
.rp-row em { font-size: 9px; color: #9a8a66; }
.rp-range { width: 100%; margin: 6px 0 0; accent-color: #b8862f; }
input[type="range"].rp-range { width: 100%; height: 22px; }

/* 전투 결과 — 부상병 줄 */
.rm-wound { display: flex; align-items: baseline; gap: 4px; padding: 4px 7px; border-radius: 7px; background: rgba(168, 68, 58, 0.1); border: 1px solid rgba(168, 68, 58, 0.28); }
.rm-wound span { font-size: 9px; color: #8a5a4a; }
.rm-wound b { font-family: var(--serif); font-size: 12px; color: #a8443a; }
.rm-wound em { font-size: 7.5px; color: #a08b7a; }

/* v5.42 — 결산창의 마을 점령 수당 한 줄 */
.rm-village { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 7px 0 2px; padding: 5px 9px; border-radius: 8px; background: rgba(64, 132, 78, 0.12); border: 1px solid rgba(64, 132, 78, 0.32); font-size: 10px; color: #3f6b46; }
.rm-village b { font-family: var(--serif); font-size: 13px; color: #2f6b3c; }

@media (max-width: 360px) {
  .city-mid > .city-scene { height: clamp(160px, 28vh, 240px); }
  .dev-card { padding: 5px 6px 5px 5px; gap: 5px; }
  .dc-val { font-size: 12.5px; }
  .gc-nums { gap: 3px; }
  .ct-tab { font-size: 12px; padding: 7px 0 6px; }
}

/* v5.9 — 좁은 화면에서도 [모두 증축]의 곳수·금액을 숨기지 않는다 */
.city-slots .slot-head .slot-upall em { display: inline; }

/* ══════════════════════════════════════════════════════════════════════
   v5.10 — 사계절 파티클 · 모바일 터치 스크롤 · 주점/공훈/지원군 UI
   ══════════════════════════════════════════════════════════════════════ */

/* ① 장수·시설·내정 카드 위에서도 손가락을 대고 바로 위아래로 쓸린다 */
.city-mid, .city-panes, .city-pane,
.dev-card, .slot-card, .gen-card, .ci-item, .slot-grid, .dev-grid, .gen-list {
  touch-action: pan-y; -webkit-overflow-scrolling: touch;
}

/* ② 계절 파티클 캔버스 */
.season-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.city-scene .city-season { z-index: 1; }
.world-viewport .map-season { z-index: 0; }

/* ③ [시설] 탭 상단의 배속 편의 버튼 (장수 탭에서 이동) */
.slot-tools { display: flex; align-items: center; gap: 5px; padding: 0 6px 5px; }
.st-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1px solid #47673c; border-radius: 8px; padding: 3px 8px 3px 6px;
  background: linear-gradient(180deg, #eef6e2, #d8e8c4); color: #2e5b2c;
  font-size: 9.5px; font-weight: 800; box-shadow: 0 1px 3px rgba(50, 80, 40, 0.2);
}
.st-btn span { font-family: var(--serif); font-size: 9px; background: #2e6f40; color: #fff; border-radius: 4px; padding: 1px 4px; }
.st-btn:active { filter: brightness(0.96); }
.st-btn.dim { opacity: 0.45; }
.st-btn.best { border-color: #c3a568; color: #7a6538; background: linear-gradient(180deg, #fdf6e4, #ebd9b3); }
.st-btn.best i { width: 7px; height: 7px; border-radius: 50%; background: #b9a77c; box-shadow: inset 0 0 0 1px rgba(90, 70, 30, 0.35); }
.st-btn.best.on { color: #2e6f40; border-color: #7ea36a; background: linear-gradient(180deg, #f2f8e8, #dcecc9); }
.st-btn.best.on i { background: #3f8a4e; box-shadow: 0 0 0 2px rgba(63, 138, 78, 0.18); }
.st-note { margin-left: auto; font-size: 8px; color: #8a7448; font-weight: 700; }

/* ④ [군사 조언] 버튼 — 갈색 바탕에 이름 배지를 밝은 아이보리 글씨로 선명하게 */
.city-ap .ap-delegate span, .ap-delegate span {
  font-family: var(--serif); font-size: 8px; font-weight: 900;
  background: #5a3410; color: #fff8e8; border: 1px solid #c99a52;
  border-radius: 4px; padding: 1px 4px; letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}
.ap-row2 .ap-delegate { color: #4a3410; }

/* ⑤ 건물 창 — 담당 장수 카드 (누르면 장수 상세창) */
.sd-owner {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin: 0 0 8px;
  border: 1px solid #c9a866; border-radius: 10px; padding: 6px 8px;
  background: linear-gradient(180deg, #fff8e8, #f3e5c6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.sd-owner:active { filter: brightness(0.97); }
.sd-owner .sd-face { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; object-position: 50% 16%; border: 1px solid #b3903f; flex: 0 0 auto; }
.sd-oname { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sd-oname b { font-family: var(--serif); font-size: 12px; color: #33280f; }
.sd-oname b em { font-style: normal; font-size: 9px; color: #8a5a12; background: #fbf0d6; border: 1px solid #e0c58c; border-radius: 6px; padding: 0 4px; margin-left: 3px; }
.sd-oname b i { font-style: normal; font-size: 8.5px; color: #7d4a12; margin-left: 4px; }
.sd-stats { font-size: 8.5px; color: #6b5830; }
.sd-stats b { font-size: 9px; color: #33280f; }
.sd-lvline { display: flex; align-items: center; gap: 4px; }
.sd-exp { flex: 1 1 auto; height: 5px; border-radius: 3px; background: #e6d7b4; overflow: hidden; }
.sd-exp i { display: block; height: 100%; background: linear-gradient(90deg, #b8862f, #e8c268); }
.sd-exptxt { flex: 0 0 auto; font-style: normal; font-size: 7.5px; color: #8a7448; font-weight: 700; }
.sd-go { flex: 0 0 auto; color: #b8862f; font-size: 14px; }

/* ⑥ 장수 상세창 — 보물 +N·공훈치 */
.hi-attrs b em.hi-plus { font-style: normal; font-size: 8.5px; font-weight: 800; color: #2e7d46; margin-left: 2px; }
.hi-merit { margin: 4px 0 0; font-size: 10px; color: #5b4a27; }
/* v5.62 — 성 내정 장수 상세의 보유 책략 4종 (미해금은 잠금 배지) */
.hi-skills { margin: 7px 0 2px; }
.hi-skills-head { margin: 0 0 4px; font-size: 9px; letter-spacing: 0.08em; font-weight: 800; color: #9a7b34; }
.hi-skills-head em { font-style: normal; font-weight: 800; color: #8a7448; letter-spacing: 0; }
.hi-skills .skill-row { padding: 5px 7px; gap: 7px; }
.hi-skills .skill-row .sk-mp { width: 24px; height: 24px; font-size: 10px; }
.hi-skills .skill-row b { font-size: 11.5px; }
.hi-skills .skill-row span { font-size: 9px; line-height: 1.35; }
.hi-merit b { color: #8a5a12; font-size: 11.5px; }
.hi-merit em { font-style: normal; color: #7d6538; font-size: 9px; }
.eq-chip i { font-style: normal; font-size: 7px; color: #8a7448; margin-right: 3px; }
.eq-chip.none { color: #9a8a66; border-style: dashed; background: #fbf7ee; }

/* ⑦ 공훈치 배지 (장수 카드·관아 서임) */
.gc-merit {
  font-style: normal; font-size: 7.5px; font-weight: 800; color: #7a4a12;
  background: #fbf0d6; border: 1px solid #e0c58c; border-radius: 6px; padding: 0 3px; margin-left: 2px;
}
.ap-merit { display: block; font-style: normal; font-size: 8px; font-weight: 700; color: #7d4a12; }
.ap-row.ready { box-shadow: inset 3px 0 0 #3f8a4e; }
.ap-pick.locked { border-style: dashed; }
.ap-pick.locked b { color: #6b5830; }

/* ⑧ 적 지원군 경고 */
.enemy-support, .me-support {
  margin: 4px 0; font-size: 10px; line-height: 1.45; font-weight: 700;
  color: #7a2a1e; background: #fdeee9; border: 1px solid #e2b3a6; border-radius: 8px; padding: 5px 7px;
}

/* ⑨ 전투 배속 토글 (×1 / ×2) — 전장 상단 */
.battle-speed {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 36px; padding: 2px 6px 3px; border-radius: 8px;
  border: 1px solid #8a7448; background: linear-gradient(180deg, #f6ecd4, #e2cfa3);
  color: #4a3a1a; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.battle-speed span { font-family: var(--serif); font-size: 12px; font-weight: 900; line-height: 1.05; }
.battle-speed em { font-style: normal; font-size: 7px; font-weight: 800; color: #6b5830; letter-spacing: 0.04em; }
.battle-speed.fast { background: linear-gradient(180deg, #ffe1a4, #e0a94a); border-color: #8a621e; }
.battle-speed.fast span { color: #5a3410; }
.battle-speed:active { transform: translateY(1px); }
.mr-auto-row em.cap { font-style: normal; font-size: 8.5px; color: #7d6538; }

/* ══════════════════════════════════════════════════════════════════════
   v5.11 — 지도 지붕 세력색 · 상단 계절 알약 · 성 금고 보조 표기
   ══════════════════════════════════════════════════════════════════════ */

/* ① 모든 세력 성의 지붕에 소유 세력 색(중립=회색)을 입힌다.
      아이콘 그림의 지붕 자리만 오려 색을 섞으므로 벽·성문 색은 그대로다. */
.marker .m-roof {
  position: absolute; left: 0; bottom: 0;
  width: calc(var(--ih) * 1.61); height: var(--ih);
  transform: translateX(-50%);
  pointer-events: none; opacity: 0.88; mix-blend-mode: color;
  transition: opacity 0.14s ease;
}
.marker .m-roof i { position: absolute; inset: 0; background: var(--fc, #8d8d8d); }
.marker .m-roof .r1 { clip-path: polygon(34% 2%, 66% 2%, 70% 45%, 30% 45%); }
.marker .m-roof .r2 { clip-path: polygon(3% 27%, 27% 26%, 29% 51%, 5% 52%); }
.marker .m-roof .r3 { clip-path: polygon(73% 26%, 97% 27%, 95% 52%, 71% 51%); }
.marker.mine .m-roof { opacity: 1; }
.marker.sel .m-roof { opacity: 1; }

/* ② 계절 알약 — '겨울' 두 글자가 세로로 쪼개지지 않게 */
.season-chip {
  width: auto; min-width: 22px; height: 17px; padding: 0 6px;
  border-radius: 9px; white-space: nowrap; font-size: 9.5px;
}

/* ③ 상단 HUD 금고 — 지금 성 + 전체 합계를 한 줄에 */
.map-top .res small, .city-res .res small {
  font-size: 8px; font-weight: 700; opacity: 0.78; margin-left: 1px; white-space: nowrap;
}
.map-top .res-group { min-width: 0; }
.map-top .res { flex: 0 1 auto; min-width: 0; }
.map-top .res b { font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
/* v5.21 — 자릿수별 밀도 (app.js refreshHud가 .map-top[data-res]를 정한다) */
.map-top[data-res="long"] { gap: 5px; }
.map-top[data-res="long"] .res-group { gap: 4px; }
.map-top[data-res="long"] .res { gap: 3px; }
.map-top[data-res="long"] .res b { font-size: 10px; }
.map-top[data-res="long"] .res-ic { width: 15px; height: 15px; }
.map-top[data-res="long"] .res small { display: none; }
.map-top[data-res="xlong"] { gap: 4px; }
.map-top[data-res="xlong"] .res-group { gap: 3px; }
.map-top[data-res="xlong"] .res b { font-size: 9px; }
.map-top[data-res="xlong"] .res-ic { width: 13px; height: 13px; }
.map-top[data-res="xlong"] .res small { display: none; }
.map-top[data-res="xlong"] .flag-chip span { display: none; }

/* ④ v5.11 — 장수 카드 div 전환·터치 스크롤 완전 보장 */
.city-mid, .city-mid *, .gen-card, .gen-card *,
.city-panes, .city-panes *, .city-pane, .city-pane * {
  touch-action: pan-y;
}
.gen-card { cursor: pointer; }
.gen-card:focus-visible { outline: 2px solid #3f6fb5; outline-offset: 1px; }

/* ⑤ 세이브 슬롯 */
.save-wrap { display: flex; flex-direction: column; gap: 6px; }
.save-slot {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px;
  border: 1px solid #d8c193; background: rgba(255, 252, 243, 0.94);
}
.save-slot.auto { border-color: #b7c49a; background: #f5f8ec; }
.save-slot .ss-no { flex: 0 0 46px; font-size: 9px; font-weight: 900; color: #7a5f24; }
.save-slot .ss-pt { width: 38px; height: 44px; border-radius: 7px; object-fit: cover; object-position: 50% 16%;
  border: 1.5px solid #c9a24e; background: #efe0bf; }
.save-slot .ss-pt.empty { display: grid; place-items: center; color: #b09a6a; font-size: 18px; font-weight: 700; }
.save-slot .ss-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.save-slot .ss-main b { font-family: var(--serif); font-size: 12px; color: #2f240e; }
.save-slot .ss-main span { font-size: 9px; color: #6d5a34; }
.save-slot .ss-main em { font-size: 8px; color: #a08b5e; font-style: normal; }
.save-slot .ss-btns { display: flex; gap: 3px; flex: 0 0 auto; }
.save-slot .ss-btns button { padding: 4px 7px; border-radius: 7px; border: 1px solid #c9ae7c;
  background: #fffaf0; font-size: 8.5px; font-weight: 800; color: #6b4a12; }
.save-slot .ss-btns .ss-save { background: #eef4e2; border-color: #9db97c; color: #3f6b32; }
.save-slot .ss-btns .ss-del { color: #a8443a; border-color: #e0b09a; }

/* ⑥ 포로 관리 */
.prison-list { display: flex; flex-direction: column; gap: 6px; }
.prison-row { display: flex; gap: 8px; padding: 7px; border-radius: 10px; border: 1px solid #d8c193;
  background: rgba(255, 252, 243, 0.95); }
.prison-row .pr-pt { width: 44px; height: 52px; border-radius: 8px; object-fit: cover; object-position: 50% 16%;
  border: 1.5px solid #c9a24e; }
.prison-row .pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.prison-row .pr-main b { font-family: var(--serif); font-size: 13px; color: #2f240e; }
.prison-row .pr-main span { font-size: 9px; color: #6d5a34; }
.prison-row .pr-esc { font-size: 8.5px; color: #3f6b32; font-style: normal; }
.prison-row .pr-esc.hot { color: #a8443a; }
.pr-tier { font-size: 8px; font-style: normal; padding: 0 4px; border-radius: 5px; color: #fff; vertical-align: 1px; border: 1px solid rgba(255, 255, 255, .5); }
/* v5.24 — 포로 등급 4색 통일 */
.pr-tier.tS { background: #c93024; } .pr-tier.tA { background: #7b38b5; }
.pr-tier.tB { background: #2962ba; } .pr-tier.tC { background: #2b7d4e; }
.prison-row .pr-btns { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.prison-row .pr-btns button { padding: 5px 8px; border-radius: 7px; font-size: 8.5px; font-weight: 800;
  border: 1px solid #c9ae7c; background: #fffaf0; color: #6b4a12; }
.prison-row .pr-btns .pr-hire { background: #eef4e2; border-color: #9db97c; color: #3f6b32; }
.prison-row .pr-btns button[disabled] { opacity: 0.55; }
.pr-offer { margin-top: 4px; padding: 5px 7px; border-radius: 8px; background: #fdf1d8; border: 1px solid #dcc08a;
  display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; }
.pr-offer span { font-size: 8.5px; color: #7a4a12; font-weight: 800; }
.pr-offer b { font-size: 9.5px; color: #2f240e; }
.pr-offer small { font-size: 8px; color: #a08b5e; }
.pr-offer-btns { display: flex; gap: 4px; margin-left: auto; }
.pr-offer-btns button { padding: 3px 8px; border-radius: 6px; font-size: 8.5px; font-weight: 800;
  border: 1px solid #c9ae7c; background: #fffaf0; color: #6b4a12; }
.pr-offer-btns button:first-child { background: #eef4e2; border-color: #9db97c; color: #3f6b32; }
.prison-opt.hold b { color: #3f6b32; }
/* v5.29 — 적에게 사로잡힌 아군 목록 (누가 붙잡고 있는지) */
.cap-box { margin: 4px 0 6px; padding: 6px 8px; border-radius: 8px; background: #fbf1e2; border: 1px solid #dcc0a0; }
.cap-box .cap-head { margin: 0 0 4px; color: #7a4a2a; }
.cap-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cap-row { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 7px; border-radius: 11px;
  background: #fff7ea; border: 1px solid #e0c9a6; }
.cap-row b { font-size: 9px; color: #5c3a1e; }
.cap-row em { font-style: normal; font-size: 8px; color: #9a7a5a; }

/* ⑦ 전투 결산 딜표 */
.rm-report { margin: 7px 0 4px; border-radius: 9px; border: 1px solid #d8c193; background: rgba(255, 251, 240, 0.92); overflow: hidden; position: relative; }
.rm-report-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px;
  background: #f3e6c6; border-bottom: 1px solid #dcc9a0; }
.rm-report-head b { font-family: var(--serif); font-size: 11px; color: #5a3f12; }
.rm-report-head span { font-size: 9px; color: #7a5f24; }
.rm-report-head em { font-style: normal; font-weight: 900; color: #a8443a; }
.rm-report-scroll { max-height: 176px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.rm-dmg { width: 100%; border-collapse: collapse; font-size: 9px; }
.rm-dmg th { position: sticky; top: 0; background: #fbf3df; font-size: 8px; color: #7a5f24; padding: 3px 4px; text-align: right; }
.rm-dmg th:first-child { text-align: left; }
.rm-dmg td { padding: 3px 4px; border-top: 1px solid #eee0bd; text-align: right; color: #4a3d20; }
.rm-dmg td:first-child { text-align: left; font-weight: 800; color: #2f240e; white-space: nowrap; }
.rm-dmg tr.mvp td { background: #fff6da; }
.rm-dmg td i { display: inline-block; height: 4px; border-radius: 2px; background: #c98a4a;
  vertical-align: middle; margin-right: 3px; }
.rm-fallen { font-size: 7.5px; color: #a8443a; font-style: normal; }
.rm-war { margin: 6px 0 2px; padding: 5px 8px; border-radius: 8px; background: #fdf0e8; border: 1px solid #e0b09a;
  font-size: 8.5px; color: #8a3a2a; line-height: 1.45; }
.rm-war em { display: block; font-style: normal; font-size: 8px; color: #a06050; }

/* ⑧ 관직 분과 배지 · 상단 금고 부가 정보 · 포로 */
.ap-branch { font-style: normal; font-size: 7.5px; padding: 0 4px; border-radius: 4px;
  background: #efe0bf; color: #6b4a12; vertical-align: 1px; }
.ap-pick.branch-civ .ap-branch { background: #e2ecf7; color: #2b4a6b; }
.ap-pick.branch-mil .ap-branch { background: #f6e2d8; color: #7a3a22; }
.ec-purses { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 5px; }
.ec-purse { display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 7px;
  background: #fbf3df; border: 1px solid #dcc9a0; font-size: 8.5px; color: #4a3d20; }
.ec-purse b { font-size: 8.5px; color: #5a3f12; }
.ec-purse em { font-style: normal; color: #3f6b32; }
.title-sound { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 30;
  margin: 0; padding: 3px 6px; border-radius: 9px; font-size: 12px; font-weight: 800; line-height: 1;
  color: #fff4d8; background: rgba(38, 28, 12, 0.62); border: 1px solid rgba(227, 189, 99, 0.55);
  opacity: 0.9; transition: opacity .3s; }
.title-sound.off { opacity: 0; }

/* v5.11 — 긴급 회군 목록 · 수송 호송 장수 */
.recall-list { display: flex; flex-direction: column; gap: 6px; }
.recall-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px;
  border: 1px solid #d8c193; background: rgba(255, 252, 243, 0.95); }
.recall-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recall-row b { font-family: var(--serif); font-size: 12px; color: #2f240e; }
.recall-row span { font-size: 9px; color: #6d5a34; }
.recall-row button { flex: 0 0 auto; padding: 6px 10px; border-radius: 8px; border: 1px solid #c9ae7c;
  background: #fdf1d8; font-size: 9px; font-weight: 900; color: #7a4a12; }
.escort-row { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 4px; touch-action: pan-x; }
.escort-row .ev-chip { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto;
  padding: 3px 6px 3px 3px; border-radius: 9px; border: 1px solid #d8c193; background: #fffaf0; }
.escort-row .ev-chip img { width: 22px; height: 26px; border-radius: 5px; object-fit: cover; object-position: 50% 16%; }
.escort-row .ev-chip b { font-size: 9px; color: #2f240e; }
.escort-row .ev-chip em { font-size: 7.5px; color: #8a7448; font-style: normal; }
.escort-row .ev-chip.on { border-color: #3f6fb5; background: #eaf1fb; box-shadow: 0 0 0 1px rgba(63,111,181,.3); }
.escort-row .ev-duty { font-size: 7px; color: #a8443a; font-style: normal; }

/* ═══════════════ v5.12 · 꼬마영웅 개그 한마디 (장수 상세 상단 말풍선) ═══════════════ */
.hi-gag {
  position: relative; margin: 0 0 9px; padding: 7px 11px 8px;
  border-radius: 14px 14px 14px 4px;
  border: 1.5px solid #d9a86a;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.75), transparent 58%),
    linear-gradient(168deg, #fff6df 0%, #fdecc9 58%, #f6dfae 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 235, 0.75), 0 2px 7px rgba(120, 78, 24, 0.18);
}
.hi-gag::after {
  content: ''; position: absolute; left: 20px; bottom: -7px; width: 12px; height: 12px;
  background: #f6dfae; border-right: 1.5px solid #d9a86a; border-bottom: 1.5px solid #d9a86a;
  transform: rotate(45deg) skew(6deg, 6deg);
}
.gg-tag {
  display: inline-block; margin-bottom: 3px; padding: 1px 7px; border-radius: 9px;
  font-size: 8px; font-weight: 900; letter-spacing: 0.04em; color: #fff5dd;
  background: linear-gradient(180deg, #c9803a, #a45c22); border: 1px solid #ecc88a;
  box-shadow: 0 1px 2px rgba(90, 50, 10, 0.3);
}
.gg-line {
  margin: 0; font-family: var(--serif); font-size: 12.5px; line-height: 1.42;
  color: #4a3212; letter-spacing: -0.01em; word-break: keep-all;
}
/* 시나리오 배너 — 막(幕) 뱃지와 한 줄 부제 */
.scbn-year {
  min-width: 58px; height: 27px; padding: 0 10px; border-radius: 14px;
  font-size: 13.5px; letter-spacing: 0.06em;
}
.scbn-sub {
  font-size: 9.5px; font-weight: 800; line-height: 1.32; color: #8a5a24;
  letter-spacing: -0.02em; word-break: keep-all; max-width: 100%;
}

/* ═══════════════ v5.12 · 대상인(상단 상인 칩 · 특가 보물) ═══════════════ */
.merchant-chip {
  font-size: 9px; font-weight: 800; letter-spacing: -0.02em; color: #6b3f10;
  background: linear-gradient(180deg, #ffeec4, #e7c987); border: 1px solid #b8862f;
  border-radius: 9px; padding: 1px 7px; white-space: nowrap;
  /* v5.32 — 누르면 군량 상인(대상인)이 열리는 버튼 */
  font-family: inherit; line-height: 1.35; cursor: pointer; -webkit-appearance: none; appearance: none;
  box-shadow: 0 1px 2px rgba(120, 80, 24, 0.25);
}
.merchant-chip:active { transform: scale(0.95); filter: brightness(0.96); }
.merchant-chip:focus-visible { outline: 2px solid #b8862f; outline-offset: 1px; }
.merchant-chip[hidden] { display: none !important; }
.gm-banner {
  margin: 0 0 8px; padding: 8px 10px; border-radius: 10px;
  border: 1.5px solid #d9a86a; background: linear-gradient(120deg, #fff4d8, #f7e2b4);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 235, 0.7);
}
.gm-banner b { display: block; font-family: var(--serif); font-size: 12.5px; color: #7a4a12; }
.gm-banner span { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.4; color: #8a5f2a; }
.gm-shop { margin: 8px 0 2px; }
.gm-shop-title { margin: 0 0 4px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; color: #8a7448; }
.gm-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; margin-bottom: 4px;
  border-radius: 9px; border: 1px solid #d9c396; background: rgba(255, 252, 242, 0.85);
  text-align: left;
}
.gm-item .gmi-g { flex: 0 0 auto; font-size: 8px; font-weight: 900; color: #fff8e8; border-radius: 8px;
  padding: 2px 6px; background: var(--gc, #a8443a); }
.gm-item div { flex: 1; min-width: 0; }
.gm-item b { display: block; font-size: 11.5px; color: #3a2c10; }
.gm-item span { display: block; font-size: 8.5px; color: #8a7448; line-height: 1.35; }
.gm-item em { flex: 0 0 auto; font-style: normal; font-size: 10px; font-weight: 800; color: #a45c22; }
.gm-item[disabled] { opacity: 0.45; }

/* ═══════════════ v5.12 · 건물 주담당 + 부장(2명) 표시 ═══════════════ */
.sc-owner .sc-dep { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.sc-owner .sc-dep-empty { font-size: 7px; color: #b3a27e; font-style: normal; }
.sc-owner .sc-dep-empty::before { content: '· '; color: #cdbd97; }
.sc-owner.pair { gap: 2px 5px; flex-wrap: wrap; }
.sd-owner.dep { margin-top: -4px; background: linear-gradient(180deg, #fdf5e6, #efe0c2); }
.sd-oname b .sd-role {
  font-style: normal; font-size: 8px; font-weight: 900; color: #fff5dd; background: #7d6a3c;
  border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: 1px;
}

/* ═══════════════ v5.13 · 세로 화면 전용 안내 오버레이 ═══════════════
   일반 브라우저 탭에서 가로로 돌려도 게임이 찌그러지지 않게 덮어 준다.
   (PWA·전체화면이면 manifest / screen.orientation.lock 으로 세로가 고정된다) */
#rotate-guard { display: none; }
@media (orientation: landscape) and (max-height: 560px) {
  #rotate-guard {
    position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 16px; text-align: center; color: #f4e6c2;
    background: radial-gradient(circle at 50% 40%, #3d3118 0%, #221b0d 62%, #120e07 100%);
  }
  #rotate-guard .rg-inner { max-width: 320px; }
  #rotate-guard .rg-phone { font-size: 42px; line-height: 1; display: block; margin-bottom: 10px;
    animation: rg-tilt 1.9s ease-in-out infinite; transform-origin: 50% 60%; }
  #rotate-guard b { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: 0.05em; color: #ffe6a8; }
  #rotate-guard p { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: #d9c9a2; }
  #rotate-guard em { display: block; margin-top: 10px; font-style: normal; font-size: 10px; color: #a8966c; }
}
@keyframes rg-tilt {
  0%, 100% { transform: rotate(0deg); }
  45% { transform: rotate(-90deg); }
  55% { transform: rotate(-90deg); }
}

/* ═══════════════ v5.16 · 인물·보물 도감 & 천하통일 엔딩 ═══════════════ */
#btn-map-codex .cdx-glyph { font-size: 15px; line-height: 1; }
.cdx-tabs { display: flex; gap: 6px; margin: 8px 0 6px; }
.cdx-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 4px; border-radius: 10px; border: 1.5px solid #cdb887;
  background: linear-gradient(180deg, #fbf3df, #efe0bd); color: #6b5324;
  font-family: var(--serif); font-size: 11.5px; font-weight: 800;
}
.cdx-tab b { font-size: 10px; font-weight: 700; color: #8a7448; }
.cdx-tab em { font-style: normal; font-size: 12px; font-weight: 900; color: #a4601e; }
.cdx-tab.on {
  border-color: #b8862f; color: #4a3410;
  background: linear-gradient(180deg, #fff3cd, #f0d69a);
  box-shadow: 0 0 0 2px rgba(184, 134, 47, 0.25), inset 0 1px 0 #fffdf4;
}
.cdx-body { max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding-right: 2px; }
/* v5.33 — 도감 이름 검색창 */
.cdx-search {
  display: flex; align-items: center; gap: 5px; margin: 2px 0 6px;
  padding: 5px 8px; border-radius: 10px; border: 1.5px solid #cdb887;
  background: linear-gradient(180deg, #fffdf6, #f4ead2);
  box-shadow: inset 0 1px 2px rgba(90, 70, 30, 0.12);
}
.cdx-search .cs-ico { font-size: 11px; line-height: 1; opacity: 0.75; }
.cdx-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--sans, inherit); font-size: 12.5px; color: #3b2e13;
  -webkit-appearance: none; appearance: none;
}
.cdx-search input::placeholder { color: #a4917073; }
.cdx-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.cdx-search #cdx-q-clear {
  border: 0; background: #d9c9a4; color: #4a3410; font-size: 10px; font-weight: 900;
  width: 18px; height: 18px; border-radius: 50%; line-height: 1; padding: 0; flex: 0 0 auto;
}
.cdx-qinfo { margin: -2px 0 6px; font-size: 10.5px; font-weight: 800; color: #8a6a2c; }
.cdx-qinfo[hidden] { display: none; }
.cdx-cell[disabled] { opacity: 0.55; }
.cdx-cell[disabled] .cdx-name { color: #7c6636; }
.cdx-prog { margin: 6px 0 8px; }
.cdx-prog-top { display: flex; align-items: baseline; gap: 6px; font-size: 10px; color: #7c6636; }
.cdx-prog-top b { font-family: var(--serif); font-size: 11.5px; color: #4a3410; }
.cdx-prog-top span { color: #8a7448; }
.cdx-prog-top span em { font-style: normal; font-weight: 900; color: #a4601e; }
.cdx-prog-top strong { margin-left: auto; font-size: 13px; color: #a4601e; }
.cdx-bar { display: block; height: 7px; margin-top: 4px; border-radius: 6px; background: #e4d5b2; overflow: hidden; box-shadow: inset 0 1px 2px rgba(90, 70, 30, 0.25); }
.cdx-bar s { display: block; height: 100%; text-decoration: none; border-radius: 6px; background: linear-gradient(90deg, #d9a94e, #b8862f); }
.cdx-filters { display: flex; flex-direction: column; gap: 4px; margin-bottom: 7px; }
.cdx-filters > div { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cdx-filters > div::-webkit-scrollbar { display: none; }
.cdx-chip {
  flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; border: 1px solid #cdb887;
  background: #fbf4e3; color: #6b5324; font-size: 10.5px; font-weight: 800;
}
.cdx-chip.on { background: #5a3f14; border-color: #3d2a0c; color: #ffe9b8; }
/* v5.24 — 등급 필터 칩도 S·A·B·C 4색으로 통일 */
.cdx-chip[data-f="tier"][data-v="S"] { border-color: #e8877c; color: #a81d13; }
.cdx-chip[data-f="tier"][data-v="A"] { border-color: #bd93e2; color: #632599; }
.cdx-chip[data-f="tier"][data-v="B"] { border-color: #8fb4ea; color: #1c4d9e; }
.cdx-chip[data-f="tier"][data-v="C"] { border-color: #84c9a3; color: #1e663d; }
.cdx-chip[data-f="tier"][data-v="S"].on { background: #c93024; border-color: #ff9384; color: #fff; }
.cdx-chip[data-f="tier"][data-v="A"].on { background: #7b38b5; border-color: #d9b3f7; color: #fff; }
.cdx-chip[data-f="tier"][data-v="B"].on { background: #2962ba; border-color: #a9c9ff; color: #fff; }
.cdx-chip[data-f="tier"][data-v="C"].on { background: #2b7d4e; border-color: #a3e3bf; color: #fff; }
.cdx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cdx-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 5px;
  border-radius: 9px; border: 1px solid #d9c396; background: rgba(255, 252, 242, 0.9);
  text-align: center; min-width: 0;
}
.cdx-cell.got { border-color: #cfa95e; background: linear-gradient(180deg, #fffaf0, #f4e6c6); }
.cdx-cell:disabled { opacity: 0.62; }
.cdx-face { position: relative; width: 44px; height: 50px; display: flex; align-items: flex-end; justify-content: center; }
.cdx-face img { width: 44px; height: 50px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 1px 1px rgba(60, 44, 16, 0.3)); }
.cdx-face em { font-style: normal; font-size: 17px; font-weight: 900; color: #c3b28a; }
.cdx-tier {
  position: absolute; top: -1px; right: -2px; font-style: normal; font-size: 8px; font-weight: 900;
  color: #fff; background: #7c7466; border-radius: 6px; padding: 0 4px; line-height: 12px;
  border: 1px solid rgba(255, 255, 255, .55);
}
/* v5.24 — 도감 등급 4색 통일 */
.cdx-cell.tS .cdx-tier { background: #c93024; }
.cdx-cell.tA .cdx-tier { background: #7b38b5; }
.cdx-cell.tB .cdx-tier { background: #2962ba; }
.cdx-cell.tC .cdx-tier { background: #2b7d4e; }
.cdx-name { font-size: 9.5px; font-weight: 800; color: #3a2c10; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdx-cell small { font-size: 8px; color: #9a875e; line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdx-more {
  display: block; width: 100%; margin: 8px 0 2px; padding: 8px; border-radius: 10px;
  border: 1.5px dashed #c1a366; background: rgba(255, 248, 230, 0.7); color: #7a5a1e; font-size: 11px; font-weight: 800;
}
.cdx-list { display: flex; flex-direction: column; gap: 4px; }
.cdx-row {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 9px;
  border: 1px solid #d9c396; background: rgba(255, 252, 242, 0.88);
}
.cdx-row:not(.got) { opacity: 0.6; }
.cdx-gd { flex: 0 0 auto; font-size: 8px; font-weight: 900; color: #fff8e8; border-radius: 7px; padding: 2px 6px; background: var(--gc, #9a8a66); }
.cdx-row div { flex: 1; min-width: 0; }
.cdx-row b { display: block; font-size: 11.5px; color: #3a2c10; }
.cdx-row small { display: block; font-size: 8.5px; line-height: 1.35; color: #8a7448; }
.cdx-check { flex: 0 0 auto; font-style: normal; font-size: 13px; font-weight: 900; color: #3f7a5a; }
.cdx-row:not(.got) .cdx-check { color: #b3a27e; }
.cdx-detail { display: flex; gap: 10px; align-items: flex-start; }
.cdx-detail > img { flex: 0 0 auto; width: 86px; height: 104px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 2px 3px rgba(50, 36, 10, 0.35)); }
.cdx-detail-main { flex: 1; min-width: 0; }
.cdx-detail-tag { margin: 0 0 6px; font-size: 10.5px; color: #7c6636; }
.cdx-detail-tag b { color: #a4601e; }
.cdx-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.cdx-stat { flex: 1 1 46px; display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 8px; border: 1px solid #ddc9a0; background: #fffaf0; }
.cdx-stat i { font-style: normal; font-size: 8.5px; color: #9a875e; }
.cdx-stat b { font-size: 14px; color: #3a2c10; }
.cdx-detail-skill { margin: 8px 0 0; font-size: 10.5px; color: #6b5324; line-height: 1.5; }
/* v5.32 — 전원 열전(한 줄 대사) · 생년/등장 · 보물 획득 경로 */
.cdx-detail-story { margin: 7px 0 0; padding: 6px 8px; border-radius: 8px; border: 1px dashed #d9c396; background: #fffaf0; font-size: 10.5px; line-height: 1.5; color: #5d4a24; }
.cdx-detail-meta { display: block; margin: 6px 0 0; font-size: 9px; color: #9a875e; }
.cdx-row[data-tid] { cursor: pointer; }
.cdx-row[data-tid]:active { transform: scale(0.99); }
.cdx-hint { display: block; margin-top: 2px; font-style: normal; font-size: 8px; line-height: 1.35; color: #a4601e; opacity: 0.9; }
.cdx-tre-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cdx-tre-top b { font-size: 11.5px; color: #3a2c10; }
.cdx-tre-top em { font-style: normal; margin-left: auto; font-size: 9px; font-weight: 800; color: #7a5a1c; }
.cdx-tre-effect { margin: 8px 0 4px; padding: 7px 9px; border-radius: 8px; border: 1px solid #ddc9a0; background: #fffaf0; font-size: 11px; line-height: 1.55; color: #3a2c10; }
.cdx-tre-stat { margin: 0 0 4px; font-size: 9.5px; color: #6b5324; }
.cdx-tre-hint { margin: 0; font-size: 9.5px; line-height: 1.5; color: #7c6636; }
.cdx-tre-hint b { color: #a4601e; }
/* v5.33 — 힌트 아래 '지역' 줄 (어느 성·지역에서 노릴지) */
.cdx-where { display: block; margin-top: 1px; font-style: normal; font-size: 8px; line-height: 1.35; color: #6f5a2c; opacity: 0.95; }
.cdx-tre-where { margin: 4px 0 0; font-size: 9.5px; line-height: 1.5; color: #6f5a2c; }
.cdx-tre-where b { color: #a4601e; }
.cdx-tre-where small { display: block; margin-top: 2px; font-size: 8.5px; color: #8a7448; }
.unify-card { text-align: center; padding: 4px 0 2px; }
.unify-seal {
  display: inline-block; padding: 10px 14px; margin-bottom: 6px; border-radius: 6px;
  border: 3px double #b8862f; color: #a8443a; font-family: var(--serif); font-size: 26px; font-weight: 900;
  letter-spacing: 0.18em; background: radial-gradient(circle at 50% 40%, #fff7e2, #f2dfb2);
  box-shadow: 0 2px 8px rgba(90, 60, 16, 0.25);
}
.unify-lord { display: block; width: 96px; height: 116px; margin: 2px auto 6px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 3px 5px rgba(40, 28, 8, 0.4)); }
.unify-line { margin: 0 0 6px; font-size: 11.5px; line-height: 1.65; color: #4a3a1c; }
.unify-line b { color: #8a3a22; }
.unify-rank { display: inline-block; margin-bottom: 8px; padding: 3px 12px; border-radius: 999px; font-family: var(--serif); font-size: 12px; font-weight: 900; color: #fff6dc; background: linear-gradient(180deg, #b8862f, #8a5a1a); box-shadow: 0 1px 3px rgba(60, 40, 8, 0.4); }
.unify-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 8px; }
.unify-stats > div { padding: 5px 3px; border-radius: 9px; border: 1px solid #ddc9a0; background: #fffaf0; }
.unify-stats span { display: block; font-size: 8.5px; color: #9a875e; }
.unify-stats b { display: block; font-size: 12px; color: #3a2c10; }
.unify-note { margin: 0; font-size: 9.5px; color: #8a7448; line-height: 1.5; }
.rm-dmg tfoot .rm-sum td { border-top: 1.5px solid #c9a86a; font-weight: 900; color: #6b4a12; background: #fbf1da; }
/* v5.25 — 결산표가 길어도 합계줄은 항상 보이게 */
.rm-dmg tfoot { position: sticky; bottom: 0; z-index: 1; }
.rm-sum-bar { display: grid; grid-template-columns: 1fr repeat(4, minmax(0, auto)); gap: 6px; align-items: center;
  padding: 4px 4px 5px; border-top: 1.5px solid #c9a86a; background: #fbf1da;
  font-size: 9px; font-weight: 900; color: #6b4a12; border-radius: 0 0 8px 8px; }
.rm-sum-bar span { text-align: left; }
.rm-sum-bar b { text-align: right; font-size: 9px; }
.rm-sum-bar b:nth-of-type(1) { min-width: 46px; }
.rm-sum-bar b:nth-of-type(2) { min-width: 40px; }
.rm-sum-bar b:nth-of-type(3) { min-width: 32px; }

/* ══════════════════════════════════════════════════════════════
   v5.17 — 성곽 겹수(1중·2중·3중) 내정 화면 차별화 + 전직 연출 + 결산 표기
   ══════════════════════════════════════════════════════════════ */
/* 성 그림 위 성곽 장식 — 겹수만큼 겹테를 두르고 모서리에 망루를 세운다 */
.city-scene.ring-1::before,
.city-scene.ring-2::before,
.city-scene.ring-3::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  border-radius: 2px;
}
.city-scene.ring-1::before {
  box-shadow: inset 0 0 0 2px rgba(196, 158, 86, 0.5);
}
.city-scene.ring-2::before {
  box-shadow: inset 0 0 0 2px rgba(196, 158, 86, 0.55), inset 0 0 0 7px rgba(60, 44, 20, 0.28), inset 0 0 0 9px rgba(214, 176, 100, 0.45);
}
.city-scene.ring-3::before {
  box-shadow: inset 0 0 0 2px rgba(214, 176, 100, 0.6), inset 0 0 0 6px rgba(50, 36, 16, 0.32),
              inset 0 0 0 9px rgba(226, 186, 92, 0.5), inset 0 0 0 13px rgba(40, 30, 14, 0.26), inset 0 0 0 16px rgba(238, 200, 110, 0.42);
}
.city-scene.ring-2 .city-life, .city-scene.ring-3 .city-life {
  inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px);   /* 성벽 테두리 안쪽에만 사람이 걷게 */
}
.sb-wall-badge {
  position: absolute; left: 8px; top: 8px; z-index: 4;
  padding: 3px 8px; border-radius: 999px; font-style: normal;
  font-size: 9.5px; font-weight: 900; letter-spacing: 0.02em;
  color: #fff6dc; background: linear-gradient(180deg, rgba(120, 84, 32, 0.94), rgba(74, 50, 18, 0.94));
  border: 1px solid rgba(240, 208, 130, 0.7);
  box-shadow: 0 1px 4px rgba(30, 20, 6, 0.45);
}
.sb-wall-badge.r2 { background: linear-gradient(180deg, rgba(104, 92, 64, 0.95), rgba(64, 54, 32, 0.95)); }
.sb-wall-badge.r3 { background: linear-gradient(180deg, rgba(122, 70, 40, 0.96), rgba(70, 34, 18, 0.96)); border-color: rgba(255, 214, 120, 0.85); }

/* 전직 팝업 */
.promo-pop { text-align: center; }
.promo-seal {
  display: inline-block; margin: 0 auto 6px; padding: 6px 16px; border-radius: 8px;
  font-size: 26px; line-height: 1.1; color: #4a2f0c;
  background: radial-gradient(circle at 50% 40%, #fff8e4, var(--pc, #e8c268));
  border: 2px solid rgba(120, 80, 24, 0.5);
  box-shadow: 0 3px 10px rgba(80, 52, 10, 0.3);
  animation: promoPop 0.7s ease-out;
}
@keyframes promoPop { 0% { transform: scale(0.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(3deg); } 100% { transform: scale(1); opacity: 1; } }
.promo-line { margin: 4px 0 8px; font-size: 11.5px; line-height: 1.6; color: #4a3a1c; }
.promo-line b { color: #8a3a22; }
.promo-rings { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 8px; }
.pr-dot { width: 10px; height: 10px; border-radius: 50%; background: #d9c9a4; border: 1px solid #a58a56; }
.pr-dot.done { background: linear-gradient(180deg, #ffd870, #b8862f); box-shadow: 0 0 6px rgba(255, 208, 96, 0.7); }
.promo-rings em { font-style: normal; font-size: 10px; font-weight: 900; color: #7a5a1c; margin-left: 4px; }
.promo-skills { text-align: left; margin: 6px 0; padding: 6px 8px; border-radius: 9px; border: 1px solid #ddc9a0; background: #fffaf0; }
.ps-head { display: block; font-size: 9.5px; font-weight: 900; color: #8a5a1a; margin-bottom: 4px; }
.ps-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; padding: 3px 0; border-top: 1px dotted #e2d2ae; }
.ps-row:first-of-type { border-top: 0; }
.ps-row b { font-size: 11px; color: #3a2c10; }
.ps-row i { font-style: normal; font-size: 8.5px; font-weight: 900; color: #2f6fd0; }
.ps-row em { flex: 1 1 100%; font-style: normal; font-size: 9.5px; color: #7c6636; line-height: 1.45; }
.promo-note { margin: 6px 0 0; font-size: 9.5px; color: #8a7448; line-height: 1.5; }

/* 결산 — 총대장/본진 승리 사유 · 생포/퇴각 표기 */
.rm-reason { margin: 0 0 4px; text-align: center; font-size: 11px; font-weight: 900; color: #a8443a; letter-spacing: 0.02em; }
.rm-fallen.captured { color: #b8862f; }

/* v5.17 — 전장 우측 상단 미니맵 */
.battle-minimap { position: absolute; right: 8px; top: 8px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mm-bar { display: flex; align-items: center; gap: 4px; }
/* v5.32 — 미니맵 확대/축소 토글 */
.mm-size {
  height: 20px; padding: 0 6px; border-radius: 6px; line-height: 1;
  font-size: 8.5px; font-weight: 900; letter-spacing: 0.02em; color: #ffe9b8; cursor: pointer;
  background: rgba(36, 28, 14, 0.86); border: 1.5px solid rgba(226, 186, 92, 0.8);
  box-shadow: 0 1px 4px rgba(10, 8, 4, 0.5);
}
.mm-size.on { color: #2c210c; background: linear-gradient(180deg, #ffe08a, #d9a63f); border-color: #fff0c0; }
.mm-size:active { transform: scale(0.94); }
.mm-box.big { box-shadow: 0 3px 12px rgba(10, 8, 4, 0.6), inset 0 0 0 1px rgba(255, 226, 160, 0.35); }
.mm-box.big #mm-canvas { border-radius: 5px; }
/* 확대한 미니맵이 목표 띠를 가리지 않게, 띠를 왼쪽 위로 비켜 둔다 */
.battle-stage.mm-big .battle-objective { left: 8px; transform: none; top: 8px; max-width: calc(100% - 190px); font-size: 9px; padding: 3px 8px; }
.mm-box { padding: 3px; border-radius: 7px; background: rgba(20, 15, 8, 0.78); border: 1.5px solid rgba(226, 186, 92, 0.8); box-shadow: 0 2px 8px rgba(10, 8, 4, 0.55), inset 0 0 0 1px rgba(90, 66, 24, 0.5); }
#mm-canvas { display: block; border-radius: 4px; }
/* v5.28 — 극단 줌아웃에서 미니맵 점 읽는 법 */
.mm-legend { display: none; align-items: center; justify-content: center; gap: 3px; padding: 2px 0 1px; font-size: 8px; font-weight: 800; color: #f4e6c4; letter-spacing: 0.01em; }
.mm-legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; margin-left: 3px; }
.mm-legend i.ml-a { background: #5aa0ff; }
.mm-legend i.ml-e { background: #ff5a3c; margin-left: 6px; }
.mm-legend i.ml-w { background: none; border: 1.2px solid #ffe28c; margin-left: 6px; }
.mm-toggle {
  width: 26px; height: 26px; padding: 0; border-radius: 7px; line-height: 1;
  font-size: 12px; font-weight: 900; color: #ffe9b8; cursor: pointer;
  background: rgba(36, 28, 14, 0.86); border: 1.5px solid rgba(226, 186, 92, 0.8);
  box-shadow: 0 1px 4px rgba(10, 8, 4, 0.5);
}
/* v5.41 — 좁은 화면은 미니맵이 접힌 채 시작한다 (우측 상단 적 부대·HP를 덮지 않게) */
.battle-stage.mm-collapsed .battle-minimap { opacity: 0.94; }
.mm-toggle:active { transform: scale(0.94); }
/* 미니맵이 목표 띠와 겹치지 않게 목표 띠를 살짝 아래로 */
.battle-objective { top: 42px; }

/* ══════════════════════════════════════════════════════════════
   v5.21 — 수성전 배치 (출진 장수 최대 10명 · 외성/망루/내성)
   ══════════════════════════════════════════════════════════════ */
.def-prep { display: flex; flex-direction: column; gap: 6px; }
.def-list { display: flex; flex-direction: column; gap: 5px; max-height: 44vh; overflow-y: auto; padding-right: 2px; }
.def-row {
  display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 6px;
  border: 1px solid #d3bb8a; border-radius: 9px; background: rgba(255, 252, 244, 0.72);
  padding: 5px 6px; transition: background 0.15s, border-color 0.15s;
}
.def-row.on { border-color: #47673c; background: #f2f7e6; box-shadow: inset 0 0 0 1px #47673c; }
.def-row .dr-pt { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; object-position: 50% 18%; border: 1px solid #c3a568; filter: grayscale(0.6); }
.def-row.on .dr-pt { filter: none; }
.dr-main { min-width: 0; }
.dr-main b { display: block; font-size: 12px; color: #2e2510; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-main span { font-size: 8.5px; color: #7b6538; }
.dr-zones { display: flex; gap: 2px; }
.dr-zones .dz {
  font-family: var(--serif); font-weight: 800; font-size: 9px; line-height: 1;
  padding: 5px 5px; border-radius: 6px; border: 1px solid #cfb37c; background: #fdf6e6; color: #6b5730;
  min-width: 27px;
}
.dr-zones .dz.on { background: #47673c; border-color: #38512f; color: #fff8e6; }
.def-row:not(.on) .dr-zones { opacity: 0.42; }
.dr-toggle {
  font-family: var(--serif); font-weight: 900; font-size: 9.5px; line-height: 1;
  padding: 6px 7px; border-radius: 7px; border: 1px solid #b3903f; background: #f6ecd6; color: #6b5730;
}
.dr-toggle.on { background: #7a2b26; border-color: #5d1f1b; color: #ffeccf; }
.def-sum {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px;
  border: 1px dashed #c3a568; border-radius: 8px; padding: 6px 8px; background: rgba(255, 250, 238, 0.85);
}
.def-sum > div { display: flex; justify-content: space-between; gap: 6px; font-size: 9.5px; color: #5a4a24; }
.def-sum b { font-size: 10.5px; color: #3a2d15; }
.def-sum > div:last-child { grid-column: 1 / -1; }

/* ══════════════════════════════════════════════════════════════
   v5.31 — 행군 도중 출발 성 함락 경고 (행군 도착·요격 창)
   ══════════════════════════════════════════════════════════════ */
.march-event .me-warn {
  font-size: 9.5px; line-height: 1.55; color: #8c3b22;
  background: rgba(214, 140, 60, 0.12);
  border-left: 2.5px solid #c9762f;
  border-radius: 4px; padding: 5px 7px;
}
/* 전장 부대 카드의 사기·상태이상 알약 */
#uc-buffs .bf { white-space: nowrap; }

/* ═══════════ v5.37 — 개발자 전용 AI 관전 바 (?dev=hojin) ═══════════ */
/* 일반 주소에서는 이 블록의 DOM 자체가 만들어지지 않는다.
   지도 화면의 아래 띠(내 본성 / 다음 달) 위에 한 줄로 붙는다. */
.dev-obs {
  position: relative; z-index: 7; flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 9px 7px;
  background: linear-gradient(180deg, rgba(16, 13, 8, 0.98), rgba(30, 25, 14, 0.98));
  border-top: 1px solid #6b5a2c;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
  font-family: var(--sans);
}
.dev-obs .do-row { display: flex; align-items: center; gap: 6px; }
.dev-obs .do-btn {
  flex: 0 0 auto; border: 1px solid #e3bd63; border-radius: 8px; padding: 6px 11px;
  font-size: 12.5px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1;
  color: #2c2310; background: linear-gradient(180deg, #f0d79b, #d7ae58);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.dev-obs .do-btn:active { transform: translateY(1px); }
.dev-obs .do-btn.on {
  color: #ffe2c8; border-color: #e08a6a;
  background: linear-gradient(180deg, #7a2f24, #4d1a13);
}
.dev-obs .do-speeds { display: flex; gap: 3px; flex: 0 0 auto; }
.dev-obs .do-sp {
  border: 1px solid #6b5a2c; border-radius: 6px; padding: 5px 8px;
  font-size: 11px; font-weight: 900; color: #d8c496; background: #241d10;
}
.dev-obs .do-sp.on {
  border-color: #e3bd63; color: #2c2310;
  background: linear-gradient(180deg, #f0d79b, #d7ae58);
}
.dev-obs .do-tag {
  margin-left: auto; flex: 0 0 auto;
  font-size: 9px; font-weight: 900; letter-spacing: 0.16em; color: #b7a262;
  border: 1px solid #5a4a22; border-radius: 4px; padding: 2px 5px;
}
.dev-obs .do-info {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 10.5px; font-weight: 800; color: #e8d9b4; white-space: nowrap;
}
.dev-obs .do-info i { flex: 0 0 auto; width: 1px; height: 9px; background: #5a4a22; }
.dev-obs .do-info #obs-month { flex: 0 0 auto; color: #ffe6ac; }
.dev-obs .do-info #obs-factions { flex: 0 0 auto; }
.dev-obs .do-info #obs-top { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dev-obs .do-log {
  font-size: 10.5px; line-height: 1.35; color: #c8b483;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ═══════════════ v5.46 — 📖 입문 가이드 · 계략 방어 표기 ═══════════════ */
/* 지도 상단 날짜 띠의 입문서 칩 */
.ribbon-guide {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px; border-radius: 8px; cursor: pointer;
  border: 1px solid #b8862f; background: linear-gradient(180deg, #fff8e6, #f0dba6);
  color: #5a3d12; font-family: inherit; font-size: 10px; font-weight: 900; letter-spacing: -0.04em;
  box-shadow: 0 1px 2px rgba(120, 80, 24, 0.22);
}
.ribbon-guide:active { transform: translateY(1px); }
/* 성 화면 그림 왼쪽 아래의 입문서 버튼 (지도 버튼과 짝) */
.btn-city-map.intro {
  right: auto; left: 9px;
  border-color: #d9c58e; color: #f4e6c2;
  background: linear-gradient(180deg, rgba(74, 58, 28, 0.94), rgba(46, 36, 16, 0.94));
}
.btn-city-map.intro::before { display: none; }

/* 입문 가이드 본문 */
.bg-wrap { display: flex; flex-direction: column; gap: 7px; }
.bg-tabs {
  display: flex; gap: 4px; padding: 3px; border-radius: 10px;
  background: #efe0bd; border: 1px solid #d9c396;
  position: sticky; top: 0; z-index: 2;
}
.bg-tabs button {
  flex: 1; padding: 7px 3px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 900; color: #7c6636; letter-spacing: -0.04em;
}
.bg-tabs button.on {
  background: linear-gradient(180deg, #fff8e6, #f0dba6); border-color: #b8862f; color: #4a2f0c;
  box-shadow: 0 1px 3px rgba(120, 80, 24, 0.25);
}
.bg-pane { display: none; flex-direction: column; gap: 7px; }
.bg-pane.on { display: flex; }
.bg-now {
  padding: 6px 9px; border-radius: 8px; border: 1px dashed #c9a86c; background: #fffaf0;
  font-size: 10.5px; color: #6b5324;
}
.bg-now b { font-family: var(--serif); font-size: 12px; color: #3a2d15; margin-right: 4px; }
.bg-now em { font-style: normal; font-weight: 900; color: #8a5a1a; }
.bg-card {
  display: flex; gap: 8px; padding: 8px 9px; border-radius: 10px;
  border: 1px solid #dcc9a0; border-left-width: 4px; background: #fffaf0;
}
.bg-card.gold { border-left-color: #c99a2e; }
.bg-card.green { border-left-color: #5f8b34; }
.bg-card.blue { border-left-color: #5b7387; }
.bg-card.rose { border-left-color: #a8443a; }
.bg-card.sky { border-left-color: #3f6b8a; }
.bg-ico {
  flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center;
  font-size: 16px; border-radius: 8px; background: #f4e6c6; border: 1px solid #dcc9a0;
}
.bg-ico.sm { flex: 0 0 22px; width: 22px; height: 22px; font-size: 13px; }
.bg-body { flex: 1; min-width: 0; }
.bg-head { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.bg-head b { font-family: var(--serif); font-size: 13.5px; color: #2e2510; }
.bg-head em { font-style: normal; font-size: 9px; color: #8a7448; }
.bg-tag {
  margin-left: auto; padding: 1px 6px; border-radius: 6px; font-size: 8.5px; font-weight: 900;
  color: #5a3d12; background: #f3e3bd; border: 1px solid #dcc9a0; white-space: nowrap;
}
.bg-card p { margin: 3px 0 0; font-size: 11px; line-height: 1.5; color: #4a3d20; letter-spacing: -0.02em; }
.bg-card p b { color: #8a3a20; }
.bg-note { margin: 1px 0 0; font-size: 10px; line-height: 1.45; color: #7c6636; }
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bg-bld { display: flex; gap: 6px; padding: 7px; border-radius: 9px; border: 1px solid #dcc9a0; background: #fffaf0; }
.bg-bld > div { min-width: 0; }
.bg-bld b { font-family: var(--serif); font-size: 12px; color: #2e2510; margin-right: 3px; }
.bg-bld i {
  font-style: normal; font-size: 8px; font-weight: 900; color: #8a5a1a;
  background: #f3e3bd; border-radius: 4px; padding: 0 3px;
}
.bg-bld p { margin: 2px 0 0; font-size: 9.5px; line-height: 1.4; color: #5c4a28; letter-spacing: -0.03em; }
.bg-rule {
  padding: 8px 9px; border-radius: 10px; border: 1.5px solid #b8862f;
  background: linear-gradient(180deg, #fff6de, #f5e6c2);
}
.bg-rule b { font-family: var(--serif); font-size: 12.5px; color: #6a3c0c; }
.bg-rule p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.5; color: #4a3d20; }
.bg-rule p b { color: #8a3a20; }
.bg-steps { display: flex; flex-direction: column; gap: 6px; }
.bg-step {
  display: flex; gap: 8px; padding: 8px 9px; border-radius: 10px;
  border: 1px solid #dcc9a0; background: #fffaf0;
}
.bg-num {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #fff6df;
  background: linear-gradient(180deg, #b8862f, #8a6417); border: 1px solid #6a4c10;
}
.bg-step b { font-family: var(--serif); font-size: 12.5px; color: #2e2510; }
.bg-step p { margin: 2px 0 0; font-size: 10.5px; line-height: 1.5; color: #4a3d20; }
.bg-step p b { color: #8a3a20; }
/* v5.46 — 성벽 상세의 성벽+치안 내역은 조금 크게 (안내문 8.5px는 읽기 어렵다) */
.ws-craft p.ws-def { font-size: 9.5px; line-height: 1.45; color: #5c4a28; margin-top: 3px; }
.ws-craft p.ws-def b { color: #8a3a20; }
/* 체크 전 주 버튼은 비활성으로 보이게 (탐색 보내기 등) */
.modal-actions .btn:disabled { opacity: 0.45; }

/* ═══ v5.47 — 세력 위치 미리보기 (미니 지도 모달) ═══ */
.fprev { display: flex; flex-direction: column; gap: 8px; }
.fprev-map {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 1.5px solid #b3903f; box-shadow: inset 0 0 0 1px rgba(255, 243, 208, 0.55);
  background: #d3cfb2;
}
.fprev-map canvas { display: block; }
.fprev-pulse {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2.2px solid #ffd977; background: rgba(255, 214, 120, 0.35);
  pointer-events: none; animation: fprevPulse 1.5s ease-in-out infinite;
}
.fprev-pulse.cap { width: 24px; height: 24px; margin: -12px 0 0 -12px; border-color: #ffb63d; background: rgba(255, 176, 61, 0.4); }
@keyframes fprevPulse { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.55); opacity: 0.3; } }
.fprev-head { display: flex; align-items: center; gap: 9px; }
.fprev-port { position: relative; flex: 0 0 52px; width: 52px; height: 62px; }
.fprev-port img {
  width: 52px; height: 62px; object-fit: cover; object-position: 50% 16%;
  border: 1.5px solid #d3ac56; border-radius: 5px; background: #3a2b13;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.fprev-port .fx-tier { position: absolute; right: -6px; top: -6px; }
.fprev-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* v5.65 — 직계 자식만 flex 로: 예전에는 안쪽 <b>(군주·수도 이름)까지 블록으로 쪼개져
   '군주 동탁 · 수도 낙양'이 세로로 깨졌다. */
.fprev-title > b { font-family: var(--serif); font-size: 16px; color: #2c2412; display: flex; align-items: center; gap: 5px; }
.fprev-title span { font-size: 11px; color: #6a5527; }
.fprev-title span b { display: inline; color: #3a2c10; }
.fprev-mark {
  font-style: normal; display: inline-grid; place-items: center;
  width: 19px; height: 19px; border-radius: 4px; color: #fff8e8;
  font-size: 10.5px; font-weight: 900; border: 1.4px solid #f0d69c;
}
.fprev-gens { display: flex; flex-wrap: wrap; gap: 4px; }
.fprev-gen {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px;
  border: 1px solid #dcc9a0; border-radius: 999px; background: #fffaf0;
  font-size: 9.5px; font-weight: 800; color: #4a3a18;
}
.fprev-gen img { width: 17px; height: 17px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; border: 1px solid #cfa854; }
.fprev-note { margin: 0; padding: 6px 8px; border-radius: 7px; background: rgba(255, 248, 230, 0.85); border: 1px solid #d7bd8c; font-size: 10px; line-height: 1.5; color: #5b4a27; }
.fprev-note b { color: #8a5a12; }

/* ═══════════════ v5.48 — 관아(본부) 고정 카드 · 능력치 가산점 칩 ═══════════════ */
.hq-card {
  display: flex; align-items: center; gap: 6px; width: 100%; margin: 5px 0 1px; padding: 5px 7px;
  border: 1px solid #c9a45c; border-left: 4px solid #b8862f; border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0, #f6ecda); text-align: left;
  box-shadow: 0 1px 4px rgba(90, 70, 30, 0.14);
}
.hq-card:active { background: #f3e6c8; }
.hq-card .hq-ico { width: 28px; height: 28px; object-fit: contain; flex: 0 0 auto; }
.hq-card .hq-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hq-card .hq-main b { display: flex; align-items: center; gap: 3px; font-family: var(--serif); font-size: 11px; color: #3a2d15; }
.hq-title { font-style: normal; font-size: 7.5px; font-weight: 900; letter-spacing: 0.04em; padding: 0 4px; border-radius: 6px; background: #7a3a12; color: #fff6e2; }
.hq-title.off { background: #b8443a; }
.hq-card .hq-sub { font-size: 7.5px; color: #8a7448; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hq-card .hq-vacant { font-size: 9.5px; font-weight: 800; color: #a8443a; }
.hq-card .hq-face { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1.5px solid #b8862f; }
.hq-card .hq-go { flex: 0 0 auto; font-size: 11px; color: #b8862f; }

.oh-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 1px; }
.oh-chip {
  font-style: normal; font-size: 7.5px; font-weight: 800; padding: 0 4px; border-radius: 6px;
  background: #f4e7c8; color: #6b5322; border: 1px solid #e0c58c; white-space: nowrap; line-height: 1.5;
}
.oh-chip.k-pol { background: #fbeccd; border-color: #dcbf7f; }
.oh-chip.k-tong { background: #f0e8d2; border-color: #d5c49a; color: #5c5232; }
.oh-chip.k-wu { background: #f6e2d8; border-color: #dfb8a0; color: #74452c; }
.oh-chip.k-ji { background: #e8eadd; border-color: #c3c9a8; color: #4d5a34; }
.oh-chip.k-cha { background: #f8e6e6; border-color: #e2bdb8; color: #7a3a3a; }
.oh-chip.zero { opacity: 0.5; }

.office-hq {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; text-align: left;
  border: 1px solid #c9a45c; border-left: 4px solid #b8862f; border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0, #f6ecda);
}
.office-hq:active { background: #f3e6c8; }
.office-hq .oh-ico { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }
.office-hq .oh-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.office-hq .oh-main b { display: flex; align-items: center; gap: 4px; font-family: var(--serif); font-size: 12.5px; color: #2f4728; }
.office-hq .oh-chips { margin-top: 0; }
.office-hq .oh-chip { font-size: 8px; padding: 0 5px; }
.oh-title { font-style: normal; font-size: 8.5px; font-weight: 900; letter-spacing: 0.04em; padding: 0 5px; border-radius: 7px; background: #7a3a12; color: #fff6e2; }
.oh-title.off { background: #b8443a; }
.oh-sub { font-size: 8.5px; line-height: 1.4; color: #6b5830; }
.oh-vacant { font-size: 10px; font-weight: 800; color: #a8443a; }
.office-hq .oh-face { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1.5px solid #b8862f; }
.office-hq .oh-go { flex: 0 0 auto; font-size: 12px; color: #b8862f; }

/* ══════════════════════════════════════════════════════════════
   v5.52 — 고퀄 1:1 일기토 미니게임
   전장 위에 390×844 세로 화면 한 장으로 올라온다.
   배경 = assets/duel_arena_bg.webp (황금 모래 투기장), 두 장수는 원 안쪽으로 살짝 올린다.
   ══════════════════════════════════════════════════════════════ */
.duel-arena {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; gap: 7px;
  padding: 9px max(10px, calc(50% - 205px)) 11px; color: #f9f1df;
  background: radial-gradient(circle at 50% 34%, #33220f 0%, #170f08 72%, #0b0603 100%);
  font-family: var(--sans); overflow: hidden;
}
.duel-arena[hidden] { display: none; }
.duel-arena.show { animation: duelIn 0.24s ease-out both; }
.duel-arena.out { animation: duelOut 0.2s ease-in both; }
@keyframes duelIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes duelOut { from { opacity: 1; } to { opacity: 0; } }

.duel-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(24, 16, 9, 0.9); border: 1.5px solid #b58d46; border-radius: 13px; padding: 6px 10px;
}
.duel-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #b8322c, #8a1f1b); color: #fff4d8; font-size: 11px; font-weight: 800;
  padding: 3px 9px 3px 7px; border-radius: 999px; border: 1px solid #f0b673; white-space: nowrap;
}
.duel-badge .dbl-ic { display: inline-flex; }
.duel-badge .dbl-ic svg { width: 13px; height: 13px; color: #ffe9b8; }
.duel-turn { font-size: 14px; font-weight: 900; color: #ffd980; letter-spacing: -0.01em; }
.duel-auto {
  background: linear-gradient(180deg, #4b8057, #335c3c); border: 1.5px solid #8fd19c; color: #fff;
  font-size: 11.5px; font-weight: 800; padding: 5px 10px; border-radius: 9px; white-space: nowrap;
}
.duel-auto.on { background: linear-gradient(180deg, #d8a13a, #a9741d); border-color: #ffe0a0; color: #241a08; }
.duel-auto:active { transform: translateY(1px); }

.duel-hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 5px; align-items: center; }
.duel-card {
  background: linear-gradient(180deg, rgba(252, 245, 230, 0.97), rgba(235, 219, 186, 0.97));
  color: #2b2113; border-radius: 12px; padding: 6px 7px; border: 2px solid #b59457;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); min-width: 0;
}
.duel-card.enemy { border-color: #b2413a; }
.dc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dc-head img {
  width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid #8a6c3a; background: #faf6ee;
  flex: 0 0 auto; object-fit: cover;
}
.dc-head > div { min-width: 0; }
.dc-head b { font-size: 13.5px; font-weight: 900; line-height: 1.1; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-head em { font-size: 9.5px; color: #6c5738; font-weight: 700; display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-hp { margin-top: 5px; }
.dc-hp-label { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 800; margin-bottom: 2px; }
.dc-hp-bar { height: 9px; background: #d6c7a7; border-radius: 999px; overflow: hidden; border: 1px solid #9d8558; }
.dc-hp-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b9c54, #5dc777); transition: width 0.32s ease-out; }
.duel-card.enemy .dc-hp-bar i { background: linear-gradient(90deg, #c93b32, #eb6158); }
.dc-hp-bar i.low { background: linear-gradient(90deg, #c93b32, #eb6158); }
.duel-vs { font-size: 16px; font-weight: 900; color: #ffd166; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); }

.duel-stage {
  position: relative; flex: 1; min-height: 0; margin: 1px 0; border-radius: 16px; border: 2px solid #c59b4f;
  overflow: hidden; background: #2a1a0b url('../assets/duel_arena_bg.webp') center 58% / cover no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 24px rgba(0, 0, 0, 0.35);
}
.duel-banner {
  position: absolute; top: 7px; left: 50%; transform: translateX(-50%); z-index: 6;
  width: calc(100% - 18px); max-width: 344px; text-align: center; background: rgba(16, 10, 5, 0.84);
  border: 1.5px solid #e0b35e; border-radius: 11px; padding: 5px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px);
}
.duel-banner b { display: block; font-size: 12px; color: #ffd980; }
.duel-banner span { display: block; font-size: 10.5px; color: #f6ead2; margin-top: 2px; line-height: 1.25; }
.duel-banner.on { animation: duelBannerPop 0.3s ease-out; }
@keyframes duelBannerPop {
  0% { transform: translateX(-50%) scale(0.94); opacity: 0.55; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* 두 장수 — 황금 모래 원의 가운데로 올려 세운다 (서로 마주 보게 왼쪽을 뒤집는다) */
.duel-sprite { position: absolute; bottom: 25%; z-index: 3; display: flex; flex-direction: column; align-items: center; }
.duel-sprite.ally { left: 9%; }
.duel-sprite.enemy { right: 9%; }
.duel-sprite img { width: 96px; height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.75)); }
.duel-sprite.ally img { transform: scaleX(-1); animation: duelIdleA 2.8s ease-in-out infinite; }
.duel-sprite.enemy img {
  animation: duelIdleB 2.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 10px rgba(255, 90, 40, 0.55));
}
@keyframes duelIdleA { 0%, 100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-3px); } }
@keyframes duelIdleB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.duel-bubble {
  position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #fff9ec, #efe0bd); color: #2b2113; font-size: 10.5px; font-weight: 800;
  border: 1.5px solid #b59457; border-radius: 10px; padding: 5px 8px; width: max-content; max-width: 132px;
  text-align: center; line-height: 1.25; opacity: 0; pointer-events: none; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.duel-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #efe0bd;
}
.duel-bubble.on { animation: duelBubbleIn 0.24s ease-out both; }
.duel-bubble[hidden] { display: none; }
@keyframes duelBubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 수마다 다른 타격 연출 */
.duel-fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.duel-fx-item { position: absolute; width: 170px; height: 170px; transform: translate(-50%, -50%); }
.duel-fx-item svg { width: 100%; height: 100%; overflow: visible; }
.fx-strike, .fx-speed, .fx-read, .fx-kill, .fx-guard { animation: dvFlash 0.82s ease-out forwards; }
@keyframes dvFlash {
  0% { opacity: 0.15; transform: translate(-50%, -50%) scale(0.72); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(0.96); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
}
.fx-speed .dv-s1 { animation: dvLine 0.5s ease-out both; }
.fx-speed .dv-s2 { animation: dvLine 0.5s 0.08s ease-out both; }
.fx-speed .dv-s3 { animation: dvLine 0.5s 0.16s ease-out both; }
@keyframes dvLine {
  0% { opacity: 0; stroke-dasharray: 300; stroke-dashoffset: 300; }
  45% { opacity: 1; }
  100% { opacity: 0.85; stroke-dasharray: 300; stroke-dashoffset: 0; }
}
.fx-read .dv-ring { transform-origin: 100px 100px; animation: dvRing 0.78s ease-out both; }
@keyframes dvRing { 0% { opacity: 0.4; transform: rotate(-60deg) scale(0.72); } 40% { opacity: 1; } 100% { opacity: 0.12; transform: rotate(50deg) scale(1.2); } }
.fx-read .dv-bolt { transform-origin: 100px 100px; animation: dvBolt 0.72s ease-out both; }
@keyframes dvBolt { 0% { opacity: 0.45; transform: scale(0.55) rotate(-20deg); } 34% { opacity: 0.95; } 100% { opacity: 0; transform: scale(1.35) rotate(12deg); } }
.fx-kill .dv-flame { transform-origin: 100px 112px; animation: dvFlame 0.8s ease-out both; }
@keyframes dvFlame { 0% { opacity: 0.4; transform: scale(0.55); } 26% { opacity: 1; transform: scale(1.02); } 100% { opacity: 0.12; transform: scale(1.34); } }
.fx-guard .dv-rip1 { transform-origin: 100px 100px; animation: dvRipple 0.8s ease-out both; }
.fx-guard .dv-rip2 { transform-origin: 100px 100px; animation: dvRipple 0.8s 0.12s ease-out both; }
@keyframes dvRipple { 0% { opacity: 0.95; transform: scale(0.5); } 100% { opacity: 0; transform: scale(1.28); } }

/* 일기토 화면 자체가 흔들린다 (전장은 창에 가려 보이지 않는다) */
.duel-stage.hit { animation: dvShake 0.3s ease-in-out; }
.duel-stage.hit-strong { animation: dvShakeBig 0.34s ease-in-out; }
@keyframes dvShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  45% { transform: translate(3px, -2px); }
  70% { transform: translate(-2px, -1px); }
  88% { transform: translate(1px, 1px); }
}
@keyframes dvShakeBig {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-6px, 3px); }
  40% { transform: translate(6px, -3px); }
  62% { transform: translate(-4px, -2px); }
  84% { transform: translate(3px, 2px); }
}
.duel-cmds.busy .duel-cmd { opacity: 0.5; }
.duel-cmds.done .duel-cmd { opacity: 0.38; }

.duel-dmg {
  position: absolute; z-index: 7; font-weight: 900; font-size: 20px; padding: 3px 11px; border-radius: 11px;
  background: linear-gradient(135deg, #ff512f, #dd2476); color: #fff; border: 2px solid #ffe082;
  box-shadow: 0 4px 16px rgba(255, 80, 30, 0.8); opacity: 0; pointer-events: none;
}
.duel-dmg.a { left: 9%; top: 30%; }
.duel-dmg.d { right: 7%; top: 34%; }
.duel-dmg.on { animation: duelDmg 0.92s ease-out both; }
@keyframes duelDmg {
  0% { opacity: 0; transform: translateY(6px) rotate(-6deg) scale(0.7); }
  22% { opacity: 1; transform: translateY(-4px) rotate(-6deg) scale(1.08); }
  68% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px) rotate(-6deg) scale(0.96); }
}

.duel-panel {
  background: linear-gradient(180deg, #faf2df, #efe2c4); color: #2b2113;
  border-radius: 14px; border: 2px solid #b59457; padding: 7px 8px 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}
.duel-hint {
  font-size: 9.5px; font-weight: 800; color: #5b472b; text-align: center;
  background: rgba(181, 148, 87, 0.18); border-radius: 7px; padding: 4px 6px; margin-bottom: 6px;
}
.duel-cmds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.duel-cmd {
  background: #fff9ec; border: 1.5px solid #bfa167; border-radius: 10px; padding: 5px 1px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0;
}
.duel-cmd .dcmd-ico { font-size: 17px; line-height: 1; display: grid; place-items: center; height: 21px; }
.duel-cmd .dcmd-ico svg { width: 20px; height: 20px; display: block; }
.duel-cmd[data-k="strike"] .dcmd-ico { color: #a8761a; }
.duel-cmd[data-k="speed"] .dcmd-ico { color: #178a7d; }
.duel-cmd[data-k="read"] .dcmd-ico { color: #7043c8; }
.duel-cmd[data-k="kill"] .dcmd-ico { color: #cc3f22; }
.duel-cmd[data-k="guard"] .dcmd-ico { color: #a8862a; }
.duel-cmd b { font-size: 11px; font-weight: 900; color: #2b2113; }
.duel-cmd span:last-child { font-size: 8.2px; color: #6e5838; line-height: 1.1; font-weight: 700; text-align: center; }
.duel-cmd.on { background: linear-gradient(180deg, #fff1c9, #f5d380); border-color: #b87c1e; box-shadow: 0 2px 6px rgba(184, 124, 30, 0.35); }
.duel-cmd:active { transform: translateY(1px); }
.duel-reward { margin-top: 5px; font-size: 9px; color: #5a462a; text-align: center; font-weight: 700; line-height: 1.2; }

/* 낮은 화면(390×680 등) — 원 안에 두 장수가 다 들어오게 줄인다 */
@media (max-height: 740px) {
  .duel-arena { gap: 5px; padding-top: 7px; padding-bottom: 8px; }
  .duel-sprite img { width: 82px; }
  .duel-sprite { bottom: 23%; }
  .duel-sprite.ally { left: 8%; }
  .duel-sprite.enemy { right: 8%; }
  .duel-cmd b { font-size: 10.5px; }
  .duel-cmd span:last-child { font-size: 7.6px; }
  .duel-hint { font-size: 8.8px; padding: 3px 5px; }
  .duel-reward { font-size: 8.2px; }
  .duel-bubble { font-size: 9.8px; max-width: 116px; }
  .duel-card { padding: 5px 6px; }
  .dc-head img { width: 33px; height: 33px; }
  .dc-head b { font-size: 12.5px; }
  .duel-dmg { font-size: 18px; }
  .duel-fx-item { width: 150px; height: 150px; }
}

/* ═══════════ v5.52 · 장수 명부 성(거점)별 필터 칩 ═══════════ */
.rs-citybar {
  display: flex; gap: 5px; overflow-x: auto; padding: 0 0 7px; margin: 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rs-citybar::-webkit-scrollbar { display: none; height: 0; }
.rs-citychip {
  flex: 0 0 auto; border: 1.5px solid #c4a870; background: linear-gradient(180deg, #f7ecd4, #e6d2a8);
  color: #5a4415; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800;
  white-space: nowrap; line-height: 1.25;
}
.rs-citychip b { font-weight: 900; color: #8a6a2a; margin-left: 1px; }
.rs-citychip.on {
  background: linear-gradient(180deg, #7a5a2a, #5c431c); color: #ffeec4; border-color: #e3bd63;
  box-shadow: 0 2px 6px rgba(92, 67, 28, 0.28);
}
.rs-citychip.on b { color: #ffe9a8; }
.rs-citychip:active { transform: translateY(1px); }

/* ══════════════════════════════════════════════════════════════════
   v5.53 · 조조전 스타일 《장수 정보》 팝업 (전장 · 아군/적군 공통)
   — 머리(초상·이름·등급·병과·Lv·진영·HP/MP/EXP·지형) + 3탭(능력·장비·특성·기술)
     + [이전]/[다음] 넘기기 + [닫기]. 390px 폰 세로 기준으로 짰다.
   ══════════════════════════════════════════════════════════════════ */
.gen-info {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 10px; background: rgba(16, 12, 4, 0.66); backdrop-filter: blur(2px);
}
.gen-info[hidden] { display: none; }
.gi-panel {
  width: 100%; max-width: 392px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #fdf6e4, #ecdcba);
  border: 2px solid #6f5423; border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  animation: giIn 0.16s ease-out;
}
@keyframes giIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.gi-bar {
  display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
  padding: 4px 8px 4px 11px; background: linear-gradient(180deg, #6a5227, #46340f);
  color: #ffeab4; box-shadow: inset 0 -1px 0 rgba(255, 226, 150, 0.35);
}
.gi-bar b { font-family: var(--serif); font-size: 12.5px; letter-spacing: 0.08em; }
.gi-x {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  border: 1px solid rgba(255, 226, 150, 0.55); background: rgba(255, 255, 255, 0.08);
  color: #ffeab4; font-size: 16px; line-height: 1; font-weight: 900;
}
.gi-x:active { background: rgba(255, 255, 255, 0.2); }
.gi-head {
  display: flex; gap: 9px; flex: 0 0 auto; padding: 9px 10px 8px;
  background: linear-gradient(180deg, #f7ead0, #f0e0be);
  border-bottom: 1px solid rgba(150, 116, 50, 0.32);
}
.gi-frame {
  flex: 0 0 auto; position: relative; width: 78px; height: 96px; padding: 3px; border-radius: 7px;
  background: linear-gradient(160deg, #dcbd72, #8a6a2a);
  box-shadow: inset 0 0 0 1px #f8e8bd, 0 2px 6px rgba(80, 58, 20, 0.28);
}
.gi-frame img {
  width: 100%; height: 100%; display: block; border-radius: 4px; background: #cbb287;
  object-fit: cover; object-position: 50% 16%;
}
.gi-frame .gi-lvtag {
  position: absolute; left: 3px; right: 3px; bottom: 3px; text-align: center;
  font-size: 8.5px; font-weight: 900; color: #2a1d06; background: rgba(255, 240, 200, 0.92);
  border-radius: 0 0 4px 4px; padding: 1px 0;
}
.gi-hmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gi-hname { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.gi-hname b { font-family: var(--serif); font-size: 19px; color: #2b2210; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-hname span { flex: 0 0 auto; font-size: 9.5px; color: #8a7448; }
.gi-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.gi-chip {
  flex: 0 0 auto; white-space: nowrap;
  font-size: 8.5px; font-weight: 800; padding: 1.5px 5px; border-radius: 8px;
  background: #ecdcb4; color: #6a5732; border: 1px solid #cfb47d; line-height: 1.25;
}
.gi-chip.side.ally { background: #2f6fd0; color: #f2f8ff; border-color: #24559f; }
.gi-chip.side.enemy { background: #c0392b; color: #fff2ec; border-color: #8a2b1e; }
.gi-chip.tier.tS { background: #a8443a; color: #fff3ea; border-color: #7d2f27; }
.gi-chip.tier.tA { background: #7a5aa8; color: #f7f0ff; border-color: #573d7c; }
.gi-chip.tier.tB { background: #3f7a5a; color: #f0fff6; border-color: #2a5a3e; }
.gi-chip.tier.tC { background: #8a7a5a; color: #fffaf0; border-color: #665a3f; }
.gi-chip.boss { background: #7a2e22; color: #ffe1c9; border-color: #54200f; }
.gi-chip.down { background: #4a3d20; color: #ffe3c4; border-color: #2a2210; }
.gi-bars { display: flex; flex-direction: column; gap: 2px; margin-top: 1px; }
.gi-bar2 { position: relative; height: 12px; border-radius: 4px; overflow: hidden; background: #c9b287; border: 1px solid rgba(120, 94, 40, 0.45); }
.gi-bar2 i { display: block; height: 100%; transition: width 0.25s; }
.gi-bar2.hp i { background: linear-gradient(180deg, #6fbf6a, #479144); }
.gi-bar2.mp i { background: linear-gradient(180deg, #7fb8e8, #4d86c0); }
.gi-bar2.exp i { background: linear-gradient(180deg, #f0cf78, #b8862f); }
.gi-bar2 em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 8px; font-weight: 900; color: #1b2312; letter-spacing: 0.01em; }
.gi-terrline { font-size: 8.8px; color: #4e6a3c; line-height: 1.3; }
.gi-terrline b { color: #2f5233; }
.gi-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: 0 0 auto; padding: 6px 8px 0; background: linear-gradient(180deg, #f0e0be, #eddcb8); }
.gi-tab {
  padding: 7px 4px; font-size: 11.5px; font-weight: 900; color: #6a5732;
  background: #e3d0a8; border: 1px solid #c2a76e; border-bottom: none; border-radius: 7px 7px 0 0;
}
.gi-tab.on {
  background: linear-gradient(180deg, #fff9ea, #fbf2dd); color: #2c2412;
  border-color: #8a6a2a; box-shadow: inset 0 2px 0 #d8b263;
}
.gi-actbar { flex: 0 0 auto; padding: 6px 9px 0; background: #fbf2dd; }
.gi-actbar[hidden] { display: none; }
.gi-atk {
  width: 100%; padding: 7px 6px; border-radius: 8px; font-size: 12px; font-weight: 900;
  color: #fff6e2; background: linear-gradient(180deg, #b4482f, #8a2f1c); border: 1px solid #6d2413;
  box-shadow: 0 2px 5px rgba(90, 30, 15, 0.28);
}
.gi-atk:active { transform: translateY(1px); }
.gi-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 10px 10px; background: #fbf2dd;
}
.gi-sec {
  margin: 9px 0 5px; font-size: 9.5px; font-weight: 900; letter-spacing: 0.07em; color: #8a6a2a;
  border-bottom: 1px solid rgba(150, 116, 50, 0.28); padding-bottom: 2px;
}
.gi-sec:first-child { margin-top: 0; }
.gi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.gi-grid.five { grid-template-columns: repeat(5, 1fr); }
.gi-cell { background: #fffaf0; border: 1px solid #d3bb8a; border-radius: 6px; padding: 3px 1px; text-align: center; }
.gi-cell i { display: block; font-style: normal; font-size: 8px; color: #8a7448; line-height: 1.2; }
.gi-cell b { font-size: 12.5px; color: #2e2510; font-variant-numeric: tabular-nums; }
.gi-cell b em { font-style: normal; font-size: 8.5px; color: #3f7a5a; margin-left: 1px; }
.gi-state { display: flex; flex-wrap: wrap; gap: 4px; }
.gi-st {
  font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 9px; line-height: 1.3;
  background: #ecdcb4; border: 1px solid #cfb47d; color: #6a5732;
}
.gi-st em { font-style: normal; font-size: 8px; opacity: 0.85; margin-left: 2px; }
.gi-st.good { background: rgba(96, 170, 110, 0.22); border-color: #7fbf8c; color: #2f6b3c; }
.gi-st.bad { background: rgba(190, 80, 80, 0.18); border-color: #d08a80; color: #8a3228; }
.gi-st.normal { background: #e7f0e2; border-color: #a9c8a0; color: #3f6a3c; }
.gi-st.dim { opacity: 0.62; }
.gi-eq { display: flex; flex-direction: column; gap: 5px; }
.gi-eq-row { display: flex; gap: 7px; padding: 6px 7px; border: 1px solid #d3bb8a; border-radius: 7px; background: #fffaf0; }
.gi-eq-row.none { opacity: 0.7; background: #f6ecd8; }
.gi-slot { flex: 0 0 40px; font-size: 9px; font-weight: 900; color: #8a6a2a; }
.gi-eq-row > div { flex: 1; min-width: 0; }
.gi-eq-row b { font-size: 12px; color: #2e2510; }
.gi-eq-row em { display: block; font-style: normal; font-size: 9px; color: #7b6538; margin-top: 1px; }
.gi-eq-row p { margin: 2px 0 0; font-size: 9.5px; color: #5c4a28; line-height: 1.35; }
.gi-grade { display: inline-block; font-size: 8px; font-weight: 900; padding: 0 4px; margin-right: 4px; border-radius: 6px; background: #ecdcb4; border: 1px solid #cfb47d; color: #6a5732; }
.gi-sum { margin: 5px 0 0; font-size: 9.5px; color: #4a3d20; line-height: 1.4; }
/* v5.59 — 내정·외교 적용 줄은 전장 줄과 색을 달리한다 */
.gi-sum.gi-sum-dom { color: #8a6a2a; }
.gi-note { margin: 5px 0 0; font-size: 9px; color: #8a7448; line-height: 1.4; }
.gi-trait {border: 1px solid #d3bb8a; border-radius: 7px; background: #fffaf0; padding: 6px 8px; margin-bottom: 5px; }
.gi-trait b { font-size: 12px; color: #2e2510; }
.gi-trait b em {
  font-style: normal; font-size: 8.5px; font-weight: 800; color: #a4601e;
  background: rgba(214, 168, 70, 0.18); border-radius: 6px; padding: 0 5px; margin-left: 4px;
}
.gi-trait p { margin: 3px 0 0; font-size: 9.5px; color: #5c4a28; line-height: 1.4; }
.gi-skills .skill-row { pointer-events: none; padding: 6px 8px; }
.gi-skills .skill-row span { line-height: 1.35; }
.gi-bond {
  display: flex; gap: 6px; align-items: flex-start; margin-bottom: 4px; padding: 5px 7px;
  border: 1px solid #d3bb8a; border-radius: 7px; background: #fffaf0;
}
.gi-bond.friend { border-left: 3px solid #3f7a5a; }
.gi-bond.rival { border-left: 3px solid #a8443a; }
.gi-bond-tag { flex: 0 0 auto; font-size: 8px; font-weight: 900; padding: 1px 5px; border-radius: 7px; background: #ecdcb4; color: #6a5732; }
.gi-bond > div { flex: 1; min-width: 0; }
.gi-bond b { font-size: 11px; color: #2e2510; }
.gi-bond em { font-style: normal; font-size: 9px; color: #8a7448; margin-left: 4px; }
.gi-bond p { margin: 2px 0 0; font-size: 9px; color: #5c4a28; line-height: 1.35; }
.gi-bond-on { flex: 0 0 auto; font-size: 8px; font-weight: 900; color: #2f6b3c; background: #e7f0e2; border: 1px solid #a9c8a0; border-radius: 6px; padding: 1px 4px; }
.gi-foot {
  display: flex; align-items: center; gap: 5px; flex: 0 0 auto;
  padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #e8d4ac, #dcc49a); border-top: 1px solid #b8862f;
}
.gi-nav, .gi-close {
  flex: 1 1 auto; padding: 9px 6px; border-radius: 8px; font-size: 12px; font-weight: 900;
  color: #3a2d15; background: linear-gradient(180deg, #fffaf0, #e9d7b2); border: 1px solid #b99a5e;
}
.gi-nav:active, .gi-close:active { transform: translateY(1px); }
.gi-nav:disabled { opacity: 0.4; }
.gi-pos { flex: 0 0 auto; min-width: 44px; text-align: center; font-size: 10px; font-weight: 900; color: #6a5732; font-variant-numeric: tabular-nums; }
.gi-close { flex: 0 0 66px; color: #f4ecd2; background: linear-gradient(180deg, #5a7a4a, #3a5530); border-color: #24371d; }

/* v5.53 — 아래 부대 카드에서 장수 정보 열기 (초상화 탭 / [정보]) */
.uc-portrait { cursor: pointer; }
.uc-portrait:active { filter: brightness(0.94); }
.uc-side { flex: 0 0 auto; font-style: normal; font-size: 8.5px; font-weight: 900; padding: 0 5px; border-radius: 7px; align-self: center; }
.uc-side.ally { background: #2f6fd0; color: #f2f8ff; }
.uc-side.enemy { background: #c0392b; color: #fff2ec; }
.uc-side[hidden] { display: none; }
#uc-terrain { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-info {
  flex: 0 0 auto; align-self: center; margin-left: 4px; padding: 2px 8px; border-radius: 7px;
  font-size: 9px; font-weight: 900; color: #fff6df; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #7a5a2a, #53390f); border: 1px solid #33220a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.uc-info[hidden] { display: none; }
.uc-info:active { transform: translateY(1px); }
@media (max-height: 700px) {
  .gi-head { padding: 7px 9px 6px; }
  .gi-frame { width: 64px; height: 80px; }
  .gi-hname b { font-size: 17px; }
  .gi-tab { padding: 6px 3px; font-size: 11px; }
  .gi-body { padding: 6px 9px 8px; }
}

/* v5.54 — 《장수 정보》 고유 필살기 칸 */
.gi-ult { border-color: rgba(214, 170, 70, 0.75); background: linear-gradient(180deg, rgba(255, 244, 214, 0.75), rgba(247, 232, 194, 0.55)); }
.gi-ult b { color: #6b4a10; }
.gi-ult b em { color: #8a5a12; background: rgba(255, 226, 150, 0.75); }
.gi-ult.used { opacity: 0.82; border-color: rgba(150, 130, 90, 0.6); }
.gi-ult.used b em { color: #6b6250; background: rgba(220, 210, 186, 0.8); }
.gi-ult .gi-ult-q { color: #7a5f2e; font-style: italic; }
.gi-sec-sub { font-size: 9px; font-weight: 700; color: #96773c; margin-left: 4px; }

/* ══════════════════════════════════════════════════════════════════════════
   v5.55 — 모든 초상화 테두리를 장수 등급색으로 통일
   S급 빨강+금 · A급 보라 · B급 파랑 · C급 초록
   · 클래스 하나(.tier-S/A/B/C)로 두 모양을 모두 덮는다.
     - <img class="tier-A">                    → 그림 자체에 등급색 테두리 링
     - <span class="tf tier-A"><img></span>    → 안쪽이 파인 등급색 그라데이션 액자
   · 세력색 오라(--fa) 테두리는 이 규칙이 덮는다(!important).
   ══════════════════════════════════════════════════════════════════════════ */
.tier-S { --tr-a: #d9261c; --tr-b: #ffd54a; --tr-c: #c41812; --tr-d: #ffe680; --tr-ring: #8c110b; --tr-glow: rgba(217, 38, 28, 0.45); }
.tier-A { --tr-a: #8e44ad; --tr-b: #c06cf5; --tr-c: #6c2d91; --tr-d: #d69bff; --tr-ring: #521f73; --tr-glow: rgba(142, 68, 173, 0.42); }
.tier-B { --tr-a: #2471d9; --tr-b: #63a4ff; --tr-c: #1b54a8; --tr-d: #8cc0ff; --tr-ring: #143f82; --tr-glow: rgba(36, 113, 217, 0.42); }
.tier-C { --tr-a: #2c8f4b; --tr-b: #62c47d; --tr-c: #1f6b37; --tr-d: #8ad6a2; --tr-ring: #165028; --tr-glow: rgba(44, 143, 75, 0.40); }

/* (1) 그림 자체가 액자인 초상 — 목록·버튼 안의 얼굴 */
img.tier-S, img.tier-A, img.tier-B, img.tier-C {
  border-color: var(--tr-a) !important;
  box-shadow:
    0 0 0 var(--tw1, 2px) var(--tr-a),
    0 0 0 calc(var(--tw1, 2px) + var(--tw2, 1.2px)) var(--tr-b),
    0 0 0 calc(var(--tw1, 2px) + var(--tw2, 1.2px) + var(--tw3, 0.7px)) var(--tr-ring) !important;
}
/* (2) 액자 안에 그림이 들어가는 초상 — 성·명부·전장 카드 */
.tf.tier-S, .tf.tier-A, .tf.tier-B, .tf.tier-C {
  padding: var(--tf-pad, 2.5px) !important;
  border-color: var(--tr-ring) !important;
  background-color: transparent !important;
  background-image: linear-gradient(135deg, var(--tr-a) 0%, var(--tr-b) 45%, var(--tr-c) 75%, var(--tr-d) 100%) !important;
  box-shadow: 0 0 0 1px var(--tr-ring), 0 2px 7px var(--tr-glow) !important;
}
.tf.tier-S > img, .tf.tier-A > img, .tf.tier-B > img, .tf.tier-C > img {
  border: 0 !important;
  border-radius: var(--tf-r, 6px) !important;
  box-shadow: none !important;
}
/* 둥근 액자·전용 반지름은 그대로 살린다 */
.intro-portrait.tf > img { border-radius: 50% !important; }
.gi-frame { --tf-pad: 3px; }
.gi-frame.tf > img { border-radius: 4px !important; }
.hi-portrait, .city-lord { --tf-pad: 3px; }
.uc-portrait { --tf-pad: 2.5px; }
.uc-portrait.tf > span { left: 2.5px !important; right: 2.5px !important; bottom: 2.5px !important; border-radius: 0 0 4px 4px; }
.gc-pt { --tf-pad: 2px; }
.gc-pt.tf > img { border-radius: 6px !important; }
.gc-pt.tf .gc-lv { left: 2px; bottom: 2px; }  /* v5.87a — 뱃지가 이름 옆으로 옮겨 이 규칙은 이제 걸리지 않는다 */
.mg-frame { --tf-pad: 2px; }
.mg-frame.tf > img { border-radius: 6.5px !important; }
.ult-face { --tf-pad: 2px; }
.ult-face.tf > img { border-radius: 7px !important; }
.ci-portrait { --tf-pad: 2.5px; }
.dc-card { --tf-pad: 3px; }
.dc-card.tf > img { border-radius: 8px 8px 3px 3px !important; }

/* 아주 작은 얼굴은 링을 얇게 — 목록 줄 높이와 글자를 밀지 않게 */
.rs-name img, .slot-card .sc-face, .sc-owner .sc-face,
.ev-chip img, .escort-row .ev-chip img { --tw1: 1.2px; --tw2: 1px; --tw3: 0.5px; }
.hq-face, .oh-face, .rm-prisoners img, .flag-chip img { --tw1: 1.4px; --tw2: 1px; --tw3: 0.6px; }
.crew-row img, .reward-row img { --tw1: 1.5px; --tw2: 1px; --tw3: 0.6px; }

/* ═══════════════════════════════════════════════════════════════
   v5.63 — 지도 세력일람(pill + 목록) · 성 요약 '이 성의 한 달'
   ═══════════════════════════════════════════════════════════════ */
.map-pill {
  position: absolute; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 13;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px 7px 9px; border-radius: 999px;
  border: 1px solid rgba(227, 189, 99, 0.75);
  background: linear-gradient(180deg, rgba(58, 45, 24, 0.94), rgba(30, 24, 12, 0.96));
  color: #f6e6bf; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 232, 176, 0.18);
  font-size: 11.5px; font-weight: 800; letter-spacing: -0.01em;
}
.map-pill .mp-ic { font-size: 12px; line-height: 1; }
.map-pill .mp-n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e3bd63; color: #2a1f0b; font-size: 10.5px; font-weight: 900; line-height: 18px; text-align: center;
}
.map-pill:active { transform: translateY(1px); }
#screen-map.sheet-open .map-pill,
#screen-map:has(#city-sheet:not([hidden])) .map-pill,
#screen-map.picking .map-pill { display: none; }

/* ── 세력일람 목록 ── */
.fl-list { display: flex; flex-direction: column; gap: 5px; }
.fl-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 11px;
  border: 1px solid #d8c193; text-align: left;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.97), rgba(243, 230, 202, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.12);
}
.fl-row.mine {
  border-color: #b8862f; background: linear-gradient(180deg, #fff8e2, #f3e2b6);
  box-shadow: inset 0 1px 0 #fffdf4, 0 0 0 1px rgba(184, 134, 47, 0.35), 0 2px 7px rgba(120, 88, 30, 0.18);
}
.fl-row.open { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
.fl-flag {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: #fff8e6;
  font-family: var(--serif); font-size: 13px; font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 1px 3px rgba(50, 38, 14, 0.3);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.fl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fl-l1 { display: flex; align-items: center; gap: 5px; min-width: 0; }
.fl-name {
  font-family: var(--serif); font-size: 12.5px; font-weight: 900; color: #2f240e;
  letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fl-l1 .dp-badge { margin-left: auto; }
.dp-badge.fl-me { color: #fff6e0; background: #8a6a34; }
.fl-l2 { font-size: 9.5px; color: #7d6739; letter-spacing: -0.02em; }
.fl-l2 b { color: #2f240e; font-size: 10.5px; }
.fl-bar { display: block; height: 3px; border-radius: 2px; background: rgba(160, 130, 70, 0.22); overflow: hidden; }
.fl-bar em { display: block; height: 100%; border-radius: 2px; }
.fl-go { flex: 0 0 auto; font-size: 9px; color: #a08b5e; }
.fl-row.open .fl-go { transform: rotate(180deg); }
.fl-detail {
  margin: -3px 0 2px; padding: 5px 10px 6px; border-radius: 0 0 10px 10px;
  border: 1px solid #d8c193; border-top: 0; background: rgba(246, 236, 214, 0.9);
  font-size: 9.5px; line-height: 1.45; color: #5c4a24; letter-spacing: -0.02em;
}
.fl-detail em { display: block; font-style: normal; font-size: 9px; color: #8a7448; margin-top: 2px; }

/* ── 성 요약 '이 성의 한 달' ── */
.ci-month {
  margin-top: 7px; padding: 6px 9px 7px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.96), rgba(243, 230, 202, 0.96));
  border: 1px solid #d8c193;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(96, 74, 34, 0.1);
}
.ci-mon-head { display: flex; align-items: baseline; gap: 6px; padding: 0 2px 3px; }
.ci-mon-head b { font-family: var(--serif); font-size: 11px; color: #4a3a1a; }
.ci-mon-head span { margin-left: auto; font-size: 8.5px; color: #9a8759; }
.cm-row { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 6px; padding: 4px 2px 3px; }
.cm-row + .cm-row { border-top: 1px dotted rgba(160, 130, 70, 0.24); }
.cm-lb { font-size: 9.5px; font-weight: 700; color: #7d6739; white-space: nowrap; letter-spacing: -0.02em; }
.cm-val { grid-column: 2; margin-left: auto; font-family: var(--serif); font-size: 13.5px; font-weight: 900; color: #2f240e; letter-spacing: -0.02em; white-space: nowrap; }
.cm-val.plus { color: #3f7a2a; }
.cm-val.minus { color: #a8443a; }
.cm-val.full { color: #a8443a; }
.cm-sub { grid-column: 1 / -1; font-size: 8.5px; line-height: 1.35; color: #9a8759; letter-spacing: -0.02em; }

/* ══════════════════════════════════════════════════════════════════════════
   v5.67 (?v=85) — 원정 시나리오 대기실 (비밀 · DEV 전용)
   · 표지의 비밀 입장(?exp=1 · 제목 5연타)에서만 열린다. 일반 접속에는 흔적 없음.
   · 3×3 출진 진형(최대 5명) · 공훈 연동 · 하단 4메뉴 + 출진 버튼
   ══════════════════════════════════════════════════════════════════════════ */
#screen-expedition {
  background:
    radial-gradient(circle at 50% -6%, rgba(196, 146, 62, 0.22), transparent 54%),
    linear-gradient(180deg, #34261444 0%, #1b140c 62%, #120e08 100%),
    #1b140c;
  color: #f4e6c6;
  overflow: hidden;
}

/* ── 머리줄 ── */
.exp-top {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  border-bottom: 1px solid rgba(227, 189, 99, 0.22);
  background: linear-gradient(180deg, rgba(46, 34, 18, 0.96), rgba(30, 22, 12, 0.72));
}
.exp-back {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 7px 10px; border-radius: 9px; font-size: 11.5px; font-weight: 800;
  color: #f2dfb4; background: rgba(28, 21, 11, 0.8);
  border: 1px solid rgba(227, 189, 99, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 232, 176, 0.16);
  letter-spacing: -0.03em; white-space: nowrap;
}
.exp-back:active { transform: translateY(1px); filter: brightness(0.95); }
.exp-heading { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.exp-heading small { font-size: 8.5px; font-weight: 700; letter-spacing: 0.12em; color: #c9a86a; }
.exp-heading b {
  font-family: var(--serif); font-size: 13.5px; font-weight: 900; color: #fbeecb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.03em;
}
.exp-merit {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 8px; border-radius: 999px;
  background: linear-gradient(180deg, #f2d287, #cf9c37);
  border: 1px solid #8a5f16; color: #3b2a0a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 249, 224, 0.7);
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.exp-merit em { font-style: normal; font-size: 12px; line-height: 1; }
.exp-merit b { font-size: 13px; font-weight: 900; letter-spacing: -0.02em; }
.exp-dev {
  flex: none; padding: 4px 6px; border-radius: 7px; font-size: 9px; font-weight: 800;
  color: #ffe6a8; background: rgba(168, 68, 58, 0.42);
  border: 1px dashed rgba(255, 208, 120, 0.6); line-height: 1.1;
}

/* ── 굴리는 본문 ── */
.exp-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 9px;
  display: flex; flex-direction: column; gap: 7px;
}

/* ── 시나리오 배너 ── */
.exp-banner {
  position: relative; padding: 8px 10px 9px; border-radius: 14px;
  background: linear-gradient(180deg, #f9eed8 0%, #efdcb6 62%, #e6ceA2 100%);
  border: 1px solid #b08b48; color: #2b2416;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.exp-act {
  display: inline-block; padding: 3px 9px; border-radius: 7px;
  background: linear-gradient(180deg, #b8503f, #8e3627);
  border: 1px solid #6d2418; color: #ffeede;
  font-size: 10px; font-weight: 900; letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 200, 170, 0.4);
}
.exp-banner-main { display: flex; align-items: center; gap: 9px; margin-top: 5px; }
.exp-boss {
  flex: none; width: 52px; height: 52px; border-radius: 10px;
  display: block; background: #d9c39a;
}
.exp-boss img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.exp-banner-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exp-banner-text > b {
  font-family: var(--serif); font-size: 17px; font-weight: 900; letter-spacing: -0.05em;
  color: #2a2010; line-height: 1.18;
}
.exp-banner-text > p { margin: 0; font-size: 9.5px; font-weight: 700; color: #8a7448; letter-spacing: -0.03em; }
.exp-banner-text > p b { color: #a8443a; font-weight: 900; }

.exp-chips { display: flex; gap: 4px; margin-top: 7px; }
.exp-chip {
  position: relative; flex: 1 1 0; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; letter-spacing: -0.02em;
  background: #eedfbe; border: 1px solid #d2ba8c; color: #a48f63;
}
.exp-chip.done {
  background: linear-gradient(180deg, #5b7d49, #3f5c31); border-color: #2f4726;
  color: #f3f7e4; box-shadow: inset 0 1px 0 rgba(255, 255, 220, 0.35);
}
.exp-chip.now {
  background: linear-gradient(180deg, #c4563f, #9d3527); border-color: #7a2317;
  color: #fff3e2; box-shadow: 0 0 0 2px rgba(255, 208, 130, 0.55), inset 0 1px 0 rgba(255, 220, 190, 0.4);
}
.exp-chip.boss { border-width: 2px; border-color: #8a5f16; }
.exp-chip.boss::after {
  content: '★'; position: absolute; top: -5px; right: -3px;
  font-size: 8px; line-height: 1; color: #b8862f;
  text-shadow: 0 0 2px #fff4d6;
}
.exp-chip.now.boss::after { color: #ffe08a; text-shadow: 0 0 3px #6d2418; }
.exp-chip-name {
  position: absolute; left: 50%; transform: translateX(-50%); top: -13px;
  font-size: 7.5px; font-weight: 800; color: #7d5a1d; white-space: nowrap;
}
.exp-progress-note {
  margin: 9px 0 0; font-size: 9px; line-height: 1.35; color: #8a7448; letter-spacing: -0.03em;
}
.exp-progress-note b { color: #8e3627; font-weight: 900; }

/* ── 3×3 진형 ── */
.exp-form {
  padding: 9px 10px 10px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 236, 214, 0.97), rgba(232, 214, 176, 0.97));
  border: 1px solid #b08b48; color: #2b2416;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.exp-form-head { display: flex; align-items: baseline; gap: 6px; }
.exp-form-head b { font-family: var(--serif); font-size: 13px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-form-head span { margin-left: auto; font-size: 9.5px; font-weight: 800; color: #8a5f16; }
.exp-hint { margin: 3px 0 8px; font-size: 9px; line-height: 1.35; color: #8a7448; letter-spacing: -0.03em; }
.exp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.exp-cell {
  position: relative; min-height: 76px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 11px 3px 4px;
  border: 1.5px dashed #c3a97a; background: rgba(255, 251, 240, 0.5);
  color: #a48f63; font-size: 9px; font-weight: 800; letter-spacing: -0.04em;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.exp-cell.empty { cursor: pointer; }
.exp-cell.empty:active { background: rgba(255, 246, 226, 0.9); }
.exp-cell .exp-rowtag {
  position: absolute; top: 3px; left: 4px; padding: 1px 4px; border-radius: 4px;
  font-size: 7.5px; font-weight: 800; letter-spacing: -0.02em;
  background: rgba(120, 94, 48, 0.14); color: #7d6739;
}
.exp-cell.filled {
  border: 1px solid #b99a5e; border-style: solid;
  background: linear-gradient(180deg, #fff8e8, #f2e3c4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 5px rgba(96, 74, 34, 0.18);
  color: #2b2416; cursor: pointer;
}
.exp-cell.filled::after {
  content: ''; position: absolute; inset: 1px; border-radius: 8px; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--tr-a, transparent);
}
.exp-cell.tier-S { --tr-a: #d9261c; }
.exp-cell.tier-A { --tr-a: #8e44ad; }
.exp-cell.tier-B { --tr-a: #2471d9; }
.exp-cell.tier-C { --tr-a: #2c8f4b; }
.exp-cell.sel {
  border-color: #b8862f; transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 2px #e3bd63, 0 6px 14px rgba(120, 80, 10, 0.35);
  z-index: 2;
}
.exp-face {
  width: 38px; height: 38px; border-radius: 7px; display: block; background: #dcc9a6;
  --tf-pad: 2px; --tf-r: 5px;
}
.exp-face > img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; display: block; }
.exp-cell .exp-name {
  font-family: var(--serif); font-size: 11.5px; font-weight: 900; color: #2a2010;
  letter-spacing: -0.05em; line-height: 1.1; white-space: nowrap;
}
.exp-cell .exp-sub { font-size: 7.5px; font-weight: 800; color: #8a7448; letter-spacing: -0.03em; }
.exp-cell .exp-info {
  position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9px; font-weight: 900;
  background: rgba(43, 34, 18, 0.12); color: #6b5c3d; border: 0; padding: 0; line-height: 1;
}
.exp-cell.filled .exp-rowtag { font-size: 7px; }
.exp-reserve { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.exp-slot-empty {
  padding: 7px 6px; border-radius: 9px; border: 1px dashed #c3a97a;
  background: rgba(255, 251, 240, 0.45);
  font-size: 9px; font-weight: 800; color: #a48f63; text-align: center; letter-spacing: -0.03em;
}
.exp-slot-empty b { color: #8a5f16; }

/* ── 하단 4메뉴 ── */
.exp-menus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exp-menu {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 10px 7px; border-radius: 12px; text-align: left;
  background: linear-gradient(180deg, #f9efdb, #e9d5ab);
  border: 1px solid #b08b48; color: #2b2416;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.exp-menu:active { transform: translateY(1px); filter: brightness(0.97); }
.exp-menu > span { font-size: 15px; line-height: 1.1; }
.exp-menu > b { font-family: var(--serif); font-size: 12px; font-weight: 900; letter-spacing: -0.045em; color: #2a2010; }
.exp-menu > small { font-size: 8.5px; font-weight: 700; color: #8a7448; letter-spacing: -0.03em; }

/* ── 출진 발치 ── */
.exp-foot {
  flex: none; padding: 7px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(24, 18, 10, 0.55), rgba(16, 12, 7, 0.96));
  border-top: 1px solid rgba(227, 189, 99, 0.22);
}
.exp-sortie {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: 8px 12px 9px; border-radius: 12px;
  background: linear-gradient(180deg, #c0503d 0%, #9c3526 58%, #86291d 100%);
  border: 1px solid #6d2418; color: #fff3e6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 220, 190, 0.45);
}
.exp-sortie:active { transform: translateY(1px); filter: brightness(0.97); }
.exp-sortie b { font-family: var(--serif); font-size: 16px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; }
.exp-sortie small { font-size: 9px; font-weight: 700; color: #ffd9c4; letter-spacing: -0.02em; }
.exp-sortie.disabled { filter: grayscale(0.5) brightness(0.8); }

/* ── 안내 창 안쪽 ── */
.exp-story p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: #3b3020; letter-spacing: -0.03em; }
.exp-story .exp-story-note {
  margin-top: 10px; padding: 8px 10px; border-radius: 9px;
  background: rgba(184, 134, 47, 0.13); border: 1px dashed #b99a5e;
  font-size: 11px; font-weight: 700; color: #7d5a1d;
}
.exp-pull-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.exp-pull-head .exp-pull-cost {
  margin-left: auto; padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(180deg, #f2d287, #cf9c37); border: 1px solid #8a5f16;
  font-size: 9.5px; font-weight: 900; color: #3b2a0a;
}
.exp-pull-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.exp-pull-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 3px 5px;
  border-radius: 9px; background: rgba(255, 252, 244, 0.85); border: 1px solid #d8c193;
}
.exp-pull-card .exp-face { width: 40px; height: 40px; }
.exp-pull-card b { font-size: 10px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-pull-card em { font-style: normal; font-size: 8px; font-weight: 700; color: #8a7448; }
.exp-note-line { margin: 9px 0 0; font-size: 10px; line-height: 1.45; color: #8a7448; letter-spacing: -0.03em; }
.exp-gear-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  border-top: 1px dotted rgba(160, 130, 70, 0.34);
}
.exp-gear-row:first-child { border-top: 0; }
.exp-gear-ic {
  flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(180deg, #f6e7c6, #e2c894); border: 1px solid #b99a5e; font-size: 13px;
}
.exp-gear-row div { min-width: 0; }
.exp-gear-row b { display: block; font-size: 11.5px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-gear-row em { font-style: normal; display: block; font-size: 9px; color: #8a7448; letter-spacing: -0.03em; line-height: 1.3; }
.exp-gear-row .exp-grade {
  margin-left: auto; flex: none; padding: 2px 6px; border-radius: 5px;
  font-size: 8.5px; font-weight: 900; color: #fff3e0;
  background: linear-gradient(180deg, #b8862f, #8a5f16); border: 1px solid #6d4a10;
}

/* 내 원정단 목록 */
.exp-roster-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  border-top: 1px dotted rgba(160, 130, 70, 0.34);
}
.exp-roster-row:first-child { border-top: 0; }
.exp-roster-row .exp-face { width: 38px; height: 38px; flex: none; }
.exp-roster-main { flex: 1 1 auto; min-width: 0; }
.exp-roster-main b { display: block; font-size: 12px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-roster-main span { display: block; font-size: 9px; color: #8a7448; font-weight: 700; letter-spacing: -0.03em; }
.exp-roster-main em { display: block; font-style: normal; font-size: 8.5px; color: #9a8759; letter-spacing: -0.03em; }
.exp-roster-btn {
  flex: none; padding: 6px 9px; border-radius: 8px; font-size: 10px; font-weight: 900;
  background: linear-gradient(180deg, #f7ecd4, #e6d2a8); border: 1px solid #b99a5e; color: #4a3a1a;
}
.exp-roster-btn.place { background: linear-gradient(180deg, #5b7d49, #3f5c31); border-color: #2f4726; color: #f3f7e4; }
.exp-roster-btn.off { background: linear-gradient(180deg, #f3e2d2, #ddc0ab); border-color: #b98f78; color: #8b4a3a; }
.exp-roster-btn:active { transform: translateY(1px); }
.exp-roster-status {
  flex: none; padding: 3px 7px; border-radius: 999px; font-size: 8.5px; font-weight: 900;
  background: rgba(120, 94, 48, 0.12); color: #7d6739; border: 1px solid rgba(160, 130, 70, 0.4);
}
.exp-roster-status.on { background: rgba(71, 103, 60, 0.16); color: #3f5c31; border-color: rgba(71, 103, 60, 0.45); }

/* 능력치 창 */
.exp-stat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.exp-stat-head .exp-face { width: 54px; height: 54px; }
.exp-stat-head div b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 900; color: #2a2010; letter-spacing: -0.05em; }
.exp-stat-head div span { display: block; font-size: 10px; font-weight: 700; color: #8a7448; }
.exp-stat-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.exp-stat-row > span:first-child { flex: none; width: 26px; font-size: 10px; font-weight: 800; color: #7d6739; }
.exp-stat-bar { flex: 1 1 auto; width: auto; height: 7px; border-radius: 999px; background: rgba(120, 94, 48, 0.16); overflow: hidden; }
.exp-stat-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c39b46, #8a5f16); }
.exp-stat-row > b { flex: none; width: 24px; text-align: right; font-size: 11.5px; font-weight: 900; color: #2a2010; }
.exp-skill-line {
  margin-top: 8px; padding: 7px 9px; border-radius: 9px;
  background: rgba(184, 134, 47, 0.12); border: 1px dashed #b99a5e;
  font-size: 10.5px; color: #6b4f1c; letter-spacing: -0.03em;
}
.exp-skill-line b { color: #8e3627; }

/* 랭킹 미리보기 */
.exp-rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-top: 1px dotted rgba(160, 130, 70, 0.34); }
.exp-rank-row:first-child { border-top: 0; }
.exp-rank-no { flex: none; width: 20px; text-align: center; font-size: 11px; font-weight: 900; color: #8a5f16; }
.exp-rank-row b { flex: 1 1 auto; font-size: 11.5px; font-weight: 800; color: #2a2010; letter-spacing: -0.03em; }
.exp-rank-row em { font-style: normal; font-size: 9.5px; font-weight: 800; color: #7d6739; }
.exp-rank-me { margin-top: 6px; padding: 7px 8px; border-radius: 9px; background: rgba(184, 134, 47, 0.13); border: 1px dashed #b99a5e; font-size: 10px; color: #6b4f1c; font-weight: 700; }

/* 한국어 어절이 단어 중간에서 끊기지 않게 (창 안쪽 안내문) */
.exp-note-line, .exp-story p, .exp-hint, .exp-progress-note, .exp-skill-line,
.exp-rank-me, .exp-roster-main em, .exp-pull-card em { word-break: keep-all; }

/* 좁은 화면 보정 */
@media (max-height: 700px) {
  .exp-cell { min-height: 80px; }
  .exp-face { width: 36px; height: 36px; }
  .exp-banner-text > b { font-size: 15px; }
}

/* 비밀 입장 버튼 (표지 · 기본 숨김) */
#btn-expedition.exp-entry {
  border-color: rgba(255, 196, 110, 0.85) !important;
  background: linear-gradient(180deg, rgba(122, 62, 40, 0.85), rgba(74, 34, 20, 0.9)) !important;
  color: #ffe9c9 !important;
}
#btn-expedition.exp-entry em { font-style: normal; font-size: 10px; font-weight: 800; color: #ffc46e; letter-spacing: 0.02em; }
#btn-expedition[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   v5.68 — 원정 시나리오 2단계: 세력/인연 시너지 칩 · 뽑기 연출 · 장비 장착 ·
   3×3 풀오토 전투 화면 (390×844 기준)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── ★ 별 표시 ─────────────────────────────────────────── */
.exp-star {
  display: inline-block; font-style: normal; font-size: 8px; font-weight: 900;
  color: #c2871b; margin-left: 2px; vertical-align: 1px; letter-spacing: -0.02em;
}

/* ── 세력 시너지 · 인연 칩 (3×3 진형 바로 아래) ─────────── */
.exp-synergy { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.exp-syn {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 8.5px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25;
  animation: expChipIn 0.28s ease-out both;
}
.exp-syn b { font-weight: 900; }
.exp-syn.fact {
  background: rgba(255, 253, 246, 0.82); border: 1.4px solid var(--fc, #8a7448);
  color: #2b2416; box-shadow: 0 1px 4px rgba(96, 74, 34, 0.16);
}
.exp-syn.fact em {
  font-style: normal; font-weight: 900; color: #fff; background: var(--fc, #8a7448);
  border-radius: 999px; padding: 1px 5px; font-size: 8px;
}
.exp-syn.bond {
  background: linear-gradient(180deg, #f8e6b0, #e6c678);
  border: 1px solid #a9832f; color: #4a3510;
  box-shadow: 0 1px 4px rgba(96, 74, 34, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.exp-syn-empty { font-size: 8.5px; font-weight: 800; color: #a48f63; letter-spacing: -0.03em; }
.exp-syn-link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 900;
  color: #8e3627; text-decoration: underline; cursor: pointer;
}
@keyframes expChipIn { from { opacity: 0; transform: translateY(-3px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ── 능력치 창 보강 (장비 합산 · 별) ────────────────────── */
.exp-stat-up { font-style: normal; font-size: 7.5px; font-weight: 900; color: #3f7a2e; margin-left: 1px; }
.exp-eq-bonus { display: block; font-style: normal; font-size: 9px; font-weight: 800; color: #3f5c31; margin-top: 2px; }
.exp-eq-mini {
  margin-top: 9px; padding: 6px 9px; border-radius: 9px;
  background: rgba(184, 134, 47, 0.1); border: 1px dashed #c3a97a;
  display: flex; flex-direction: column; gap: 1px;
}
.exp-eq-row.mini { border: 0; padding: 1px 0; gap: 6px; }
.exp-eq-row.mini .exp-eq-ic { width: 18px; height: 18px; font-size: 10px; border-radius: 5px; }
.exp-eq-row.mini b { display: inline; font-size: 8.5px; color: #8a7448; margin-right: 4px; }
.exp-eq-row.mini em { display: inline; font-size: 9.5px; color: #2a2010; font-weight: 800; }

/* ── 장비 장착 창 ───────────────────────────────────────── */
.exp-eq-row {
  display: flex; align-items: center; gap: 7px; padding: 6px 2px;
  border-top: 1px dotted rgba(160, 130, 70, 0.34);
}
.exp-eq-row:first-child { border-top: 0; }
.exp-eq-ic {
  flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(180deg, #f6e7c6, #e2c894); border: 1px solid #b99a5e; font-size: 13px;
}
.exp-eq-main { flex: 1 1 auto; min-width: 0; }
.exp-eq-main > b { display: block; font-size: 8.5px; font-weight: 800; color: #8a7448; letter-spacing: 0.02em; }
.exp-eq-name { display: block; font-size: 11.5px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-eq-name em { font-style: normal; font-size: 8.5px; font-weight: 800; color: #9a7c3c; margin-left: 3px; }
.exp-eq-main em { display: block; font-style: normal; font-size: 8.5px; line-height: 1.3; color: #9a8759; letter-spacing: -0.03em; }
.exp-eq-row.empty .exp-eq-main em { color: #b3a381; }
.exp-eq-btn {
  flex: none; padding: 5px 8px; border-radius: 8px; font-size: 9.5px; font-weight: 900;
  background: linear-gradient(180deg, #5b7d49, #3f5c31); border: 1px solid #2f4726; color: #f3f7e4;
}
.exp-eq-btn.off { background: linear-gradient(180deg, #f3e2d2, #ddc0ab); border-color: #b98f78; color: #8b4a3a; }
.exp-eq-btn:active { transform: translateY(1px); }

/* 장비 고르기 목록 */
.exp-gear-row div { flex: 1 1 auto; min-width: 0; }
.exp-gear-row .exp-grade { margin-left: auto; }
.exp-gear-stat { color: #7d6739 !important; font-weight: 800 !important; }
.exp-gear-btn {
  flex: none; margin-left: 5px; padding: 5px 9px; border-radius: 8px;
  font-size: 9.5px; font-weight: 900; background: linear-gradient(180deg, #5b7d49, #3f5c31);
  border: 1px solid #2f4726; color: #f3f7e4;
}
.exp-gear-btn:active { transform: translateY(1px); }
.exp-roster-btn.gear {
  background: linear-gradient(180deg, #e8d9b6, #d3bd8d); border-color: #b08b48; color: #4a3a1a;
}

/* ── 뽑기 창 ────────────────────────────────────────────── */
.exp-pull-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.exp-pull-head .exp-pull-cost:first-child { margin-left: 0; }
.exp-pull-rate { margin-left: auto; font-size: 8.5px; font-weight: 800; color: #8a7448; letter-spacing: -0.02em; }
.exp-pull-note { margin: 0 0 8px; font-size: 9px; line-height: 1.45; color: #8a7448; letter-spacing: -0.03em; }
.exp-pull-note b { color: #8e3627; }
.exp-pull-stage { min-height: 148px; display: flex; flex-direction: column; justify-content: center; }
.exp-pull-idle {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
  border-radius: 12px; border: 1px dashed #c3a97a; background: rgba(255, 252, 244, 0.6);
}
.exp-pull-idle span { font-size: 26px; line-height: 1; }
.exp-pull-idle p { margin: 0; text-align: center; font-size: 10.5px; line-height: 1.5; color: #8a7448; font-weight: 700; letter-spacing: -0.03em; }
.exp-pull-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.exp-pull-btns .btn { padding: 10px 6px; font-size: 12px; font-weight: 900; }
.exp-pull-sum { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font-size: 9px; font-weight: 800; color: #8a7448; }
.exp-pull-sum b { font-family: var(--serif); font-size: 12.5px; font-weight: 900; color: #2a2010; }

/* 소환 카드 */
.exp-summon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.exp-summon {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 3px 8px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #fffaf0, #efdfbe); border: 1.5px solid #cbb07a;
  animation: expSummon 0.44s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.exp-summon::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 0%, rgba(255, 255, 255, 0.75), transparent 70%);
}
.exp-summon .exp-face { width: 44px; height: 44px; position: relative; }
.exp-summon b { position: relative; font-family: var(--serif); font-size: 11px; font-weight: 900; color: #2a2010; letter-spacing: -0.05em; }
.exp-summon em { position: relative; font-style: normal; font-size: 7.5px; font-weight: 800; color: #8a7448; letter-spacing: -0.03em; white-space: nowrap; }
.exp-summon-star { position: relative; font-size: 8px; font-weight: 900; color: #c2871b; letter-spacing: 0.02em; line-height: 1; }
.exp-summon-tag {
  position: absolute; top: 3px; right: 3px; padding: 1px 5px; border-radius: 999px;
  font-size: 7.5px; font-weight: 900; color: #fff; background: #8a7448; z-index: 2;
}
.exp-summon-tag.new { background: linear-gradient(180deg, #5f9c46, #3f7a2e); }
.exp-summon-tag.star { background: linear-gradient(180deg, #e8b336, #a8741a); color: #3b2a0a; }
.exp-summon-tag.refund { background: #9a8759; }
.exp-summon.tier-S { border-color: #d9261c; box-shadow: 0 0 0 1px rgba(217, 38, 28, 0.35), 0 3px 12px rgba(217, 38, 28, 0.28); }
.exp-summon.tier-A { border-color: #8e44ad; box-shadow: 0 0 0 1px rgba(142, 68, 173, 0.3); }
.exp-summon.tier-B { border-color: #2471d9; }
.exp-summon.tier-C { border-color: #2c8f4b; }
.exp-summon.tier-S b { color: #8e1d14; }
.exp-summon.gear .exp-gear-ic.big { width: 44px; height: 44px; font-size: 21px; }
.exp-summon.gear b { font-size: 10.5px; }
.exp-summon.gear.grade-legend { border-color: #a8443a; box-shadow: 0 0 0 1px rgba(168, 68, 58, 0.35), 0 3px 12px rgba(168, 68, 58, 0.24); }
.exp-summon.gear.grade-hero { border-color: #7a5aa8; box-shadow: 0 0 0 1px rgba(122, 90, 168, 0.28); }
.exp-summon.gear.grade-rare { border-color: #3f7a5a; }
.exp-summon.gear.grade-common { border-color: #b9a97e; }
@keyframes expSummon {
  0% { opacity: 0; transform: rotateY(-85deg) scale(0.82); }
  60% { opacity: 1; transform: rotateY(6deg) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

/* ── 인연 도감 창 ───────────────────────────────────────── */
.exp-bond-faction {
  padding: 8px 10px; border-radius: 10px; margin-bottom: 8px;
  background: rgba(184, 134, 47, 0.12); border: 1px dashed #b99a5e;
  font-size: 9.5px; line-height: 1.55; color: #6b4f1c; letter-spacing: -0.03em;
}
.exp-bond-faction b { color: #8e3627; }
.exp-bond-faction em { display: block; font-style: normal; margin-top: 3px; color: #3f5c31; font-weight: 800; }
.exp-bond-row { padding: 7px 3px; border-top: 1px dotted rgba(160, 130, 70, 0.34); }
.exp-bond-row:first-of-type { border-top: 0; }
.exp-bond-row.on { background: rgba(95, 156, 70, 0.07); border-radius: 8px; }
.exp-bond-head { display: flex; align-items: center; gap: 6px; }
.exp-bond-head b { font-size: 11.5px; font-weight: 900; color: #2a2010; letter-spacing: -0.04em; }
.exp-bond-badge {
  margin-left: auto; padding: 2px 7px; border-radius: 999px; font-size: 8px; font-weight: 900;
  background: rgba(120, 94, 48, 0.14); color: #8a7448;
}
.exp-bond-row.on .exp-bond-badge { background: linear-gradient(180deg, #5f9c46, #3f7a2e); color: #fff; }
.exp-bond-row > em { display: block; font-style: normal; font-size: 9px; color: #8a7448; margin: 2px 0 4px; letter-spacing: -0.03em; }
.exp-bond-mems { display: flex; flex-wrap: wrap; gap: 3px; }
.exp-bond-mem {
  padding: 1px 6px; border-radius: 999px; font-size: 8.5px; font-weight: 800;
  background: rgba(120, 94, 48, 0.1); color: #8a7448; border: 1px solid rgba(160, 130, 70, 0.3);
}
.exp-bond-mem.on { background: rgba(95, 156, 70, 0.16); color: #3f5c31; border-color: rgba(63, 122, 46, 0.5); }

/* ── 출진 창 ────────────────────────────────────────────── */
.exp-story-sub { color: #8a7448 !important; font-size: 11px !important; }
.exp-story-boss {
  padding: 6px 9px; border-radius: 8px;
  background: rgba(168, 68, 58, 0.1); border: 1px dashed #b06a52;
}
.exp-story-boss b { color: #8e2418; }
.exp-sortie-party { display: flex; align-items: center; gap: 5px; margin: 2px 0 9px; }
.exp-sortie-party .exp-face { width: 34px; height: 34px; }
.exp-sortie-party em { margin-left: auto; font-style: normal; font-size: 9px; font-weight: 900; color: #8a7448; }
.exp-sortie-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.exp-sortie-stats > div {
  padding: 7px 9px; border-radius: 9px;
  background: rgba(184, 134, 47, 0.12); border: 1px solid rgba(185, 154, 94, 0.45);
}
.exp-sortie-stats span { display: block; font-size: 8.5px; font-weight: 800; color: #8a7448; }
.exp-sortie-stats b { font-size: 13px; font-weight: 900; color: #2a2010; }
.exp-reco { display: inline-block; margin-left: 3px; padding: 1px 5px; border-radius: 999px; font-size: 7.5px; font-weight: 900; vertical-align: 1px; }
.exp-reco.ok { background: #3f7a2e; color: #fff; }
.exp-reco.low { background: #b0742a; color: #fff; }
.exp-sortie-syn { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* ── 승패 결과 · 유비 영입 ─────────────────────────────── */
.exp-result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.exp-result-mark { font-size: 34px; line-height: 1; }
.exp-result-lead { margin: 0; font-size: 12.5px; font-weight: 800; color: #3b3020; text-align: center; letter-spacing: -0.03em; }
.exp-result-lead b { color: #8e2418; }
.exp-result-rows { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.exp-result-rows > div {
  padding: 7px 4px; border-radius: 9px; text-align: center;
  background: rgba(184, 134, 47, 0.12); border: 1px solid rgba(185, 154, 94, 0.5);
}
.exp-result-rows span { display: block; font-size: 8.5px; font-weight: 800; color: #8a7448; }
.exp-result-rows b { display: block; font-size: 12px; font-weight: 900; color: #2a2010; }
.exp-result-rows .exp-first {
  display: inline-block; font-style: normal; font-size: 7.5px; font-weight: 900;
  color: #fff; background: #8e3627; border-radius: 999px; padding: 1px 4px; vertical-align: 1px;
}
.exp-result-syn { margin: 6px 0 0; font-size: 9px; font-weight: 800; color: #3f5c31; text-align: center; }
.exp-congrats {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 9px 12px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(60% 60% at 50% 28%, #fff6d6, #f0dcae);
  border: 1.5px solid #c9a13c;
}
.exp-congrats-ray {
  position: absolute; inset: -45%; opacity: 0.5; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(255, 214, 120, 0.6) 0 8deg, transparent 8deg 26deg,
    rgba(255, 214, 120, 0.45) 26deg 34deg, transparent 34deg 52deg);
  animation: expSpin 10s linear infinite;
}
@keyframes expSpin { to { transform: rotate(360deg); } }
.exp-congrats-face {
  position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(90, 50, 10, 0.35), 0 0 0 2px rgba(201, 161, 60, 0.9);
  z-index: 1;
}
.exp-congrats-face > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exp-congrats > b { position: relative; font-family: var(--serif); font-size: 16px; font-weight: 900; color: #7a2418; text-align: center; letter-spacing: -0.03em; }
.exp-congrats > em { position: relative; font-style: normal; font-size: 9.5px; color: #6b4f1c; text-align: center; letter-spacing: -0.03em; }
.exp-recruit-row {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 7px;
  padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); border: 1px solid #c9a13c;
}
.exp-recruit-row .exp-face { width: 44px; height: 44px; }
.exp-recruit-row b { display: block; font-size: 13px; font-weight: 900; color: #2a2010; }
.exp-recruit-row em { display: block; font-style: normal; font-size: 9px; color: #8a7448; }
.exp-recruit-badge {
  margin-left: auto; padding: 3px 9px; border-radius: 999px;
  font-size: 9px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #c0392b, #8e2418); border: 1px solid #6d1a10;
}

/* ══════════════════════════════════════════════════════════
   3×3 풀오토 전투 화면
   ══════════════════════════════════════════════════════════ */
.exp-battle {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; gap: 5px;
  padding: calc(7px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  color: #f6ecd8; overflow: hidden;
  background:
    radial-gradient(125% 65% at 50% -8%, rgba(126, 78, 32, 0.6), transparent 62%),
    radial-gradient(90% 50% at 50% 108%, rgba(80, 50, 20, 0.5), transparent 60%),
    linear-gradient(180deg, #2b2114 0%, #17110a 46%, #241b11 100%);
}
.exp-battle[hidden] { display: none !important; }
.exp-battle::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: repeating-linear-gradient(0deg, rgba(255, 220, 160, 0.05) 0 1px, transparent 1px 3px);
}

/* 머리 */
.eb-top { position: relative; display: flex; align-items: center; gap: 7px; z-index: 2; }
.eb-btn {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 240, 210, 0.1); border: 1px solid rgba(255, 215, 150, 0.34);
  color: #ffe8c4; font-size: 13px; font-weight: 900; line-height: 1;
}
.eb-btn:active { transform: translateY(1px); }
.eb-speed {
  width: 40px; font-size: 11.5px;
  background: linear-gradient(180deg, rgba(214, 164, 74, 0.42), rgba(146, 100, 32, 0.5));
}
.exp-battle.x2 .eb-speed { background: linear-gradient(180deg, #e8b336, #a8741a); color: #2b1d05; }
.eb-title { flex: 1 1 auto; min-width: 0; }
.eb-title small { display: block; font-size: 8px; letter-spacing: 0.14em; font-weight: 800; color: #d9b47a; }
.eb-title b {
  display: block; font-family: var(--serif); font-size: 14px; font-weight: 900; color: #ffeac9;
  letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eb-turn {
  flex: none; padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 900; color: #ffd48a;
  background: rgba(255, 200, 120, 0.1); border: 1px solid rgba(255, 200, 120, 0.3);
}

/* 시너지 배지 */
.eb-bonds { position: relative; display: flex; gap: 4px; overflow-x: auto; z-index: 2; scrollbar-width: none; }
.eb-bonds::-webkit-scrollbar { display: none; }
.eb-badge {
  flex: none; padding: 2px 7px; border-radius: 999px; font-size: 8px; font-weight: 900;
  border: 1px solid rgba(255, 220, 170, 0.26); background: rgba(255, 220, 170, 0.09);
  color: #ffe3b8; white-space: nowrap; letter-spacing: -0.02em;
}
.eb-badge.fact { border-color: var(--fc, #8a7448); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.eb-badge.bond { background: linear-gradient(180deg, rgba(248, 214, 132, 0.28), rgba(170, 122, 40, 0.3)); border-color: rgba(255, 210, 130, 0.55); }
.eb-badge.none { color: #a3917a; border-style: dashed; }

/* ── 전장 — 카드 박스 없이, 바닥 위에 치비 전신이 서서 싸운다 ── */
.eb-field {
  position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  gap: 9px; padding: 0 0 0 11px; z-index: 2; overflow: hidden;
  border-radius: 13px; border: 1px solid rgba(255, 214, 150, 0.26);
  background: #1b120a;
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.66), 0 8px 20px rgba(0, 0, 0, 0.5);
  isolation: isolate;
}
/* 황금 모래 투기장 바닥 (duel_arena_bg) — 위아래는 어둠으로 잠기고 가운데가 밝다 */
.eb-ground {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(112% 52% at 50% 44%, rgba(255, 216, 148, 0.28), rgba(120, 74, 26, 0) 66%),
    linear-gradient(180deg, rgba(6, 3, 1, 0.92) 0%, rgba(14, 9, 4, 0.58) 9%, rgba(30, 19, 9, 0.16) 24%,
      rgba(30, 19, 9, 0) 48%, rgba(30, 19, 9, 0.14) 72%, rgba(12, 7, 3, 0.52) 92%, rgba(4, 2, 1, 0.9) 100%),
    url('../assets/duel_arena_bg.webp') center 62% / auto 150% no-repeat;
}
.eb-ground::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(44% 6% at 50% 50%, rgba(255, 234, 186, 0.20), transparent 74%),
    radial-gradient(80% 22% at 50% 100%, rgba(0, 0, 0, 0.5), transparent 70%),
    radial-gradient(80% 20% at 50% 0%, rgba(0, 0, 0, 0.55), transparent 70%);
}

.eb-side { position: relative; z-index: 3; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.eb-side-tag {
  position: absolute; left: -11px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 6.5px; font-weight: 900; letter-spacing: 0.16em; color: #ffb4a0; opacity: 0.72;
  text-shadow: 0 1px 2px #000; pointer-events: none;
}
.eb-side.ally .eb-side-tag { color: #b6e39d; }
.eb-grid {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0 1px;
}

/* 칸 — 테두리 없는 발판 */
.eb-cell { position: relative; min-width: 0; min-height: 0; }
.eb-cell.blank { opacity: 0.6; }
.eb-mark {
  position: absolute; left: 50%; bottom: 1px; width: 78%; height: 17%; max-height: 18px;
  transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.2) 56%, rgba(0, 0, 0, 0) 75%);
}
.eb-cell.blank .eb-mark {
  background: none; border: 1px dashed rgba(255, 226, 176, 0.15); height: 20%; max-height: 15px;
}

/* 그림 — 돌진·피격·시전은 이 층만 움직인다 */
.eb-fig {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  transform: translate(0, 0); transform-origin: 50% 100%;
  transition: transform 0.14s cubic-bezier(0.3, 0, 0.42, 1);
  will-change: transform;
}
.eb-fig.lunge {
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.03); z-index: 9;
  transition-duration: 0.16s;
}
.eb-fig.lunge .eb-sprite { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 10px rgba(255, 236, 190, 0.85)) brightness(1.08); }
/* 돌진하는 동안에는 이름표를 잠시 접어 겹침을 줄인다 */
.eb-fig.lunge .eb-tag { opacity: 0; }
.eb-tag { transition: opacity 0.12s linear; }
.eb-tag {
  flex: 0 0 auto; width: 100%; padding: 0 1px 1px;
  display: flex; flex-direction: column; align-items: center; gap: 1.5px;
}
.eb-uname {
  display: flex; align-items: center; justify-content: center; gap: 2px; max-width: 100%;
  font-family: var(--serif); font-size: 8px; font-weight: 900; line-height: 1.15; letter-spacing: -0.05em;
  color: #fff3da; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 6px rgba(0, 0, 0, 0.95);
}
.eb-uname em { font-style: normal; font-size: 6.5px; color: #ffcf6a; }
.eb-cell.boss .eb-uname { color: #ffd9c4; font-size: 8.5px; }
.eb-tier {
  flex: none; display: grid; place-items: center; width: 11px; height: 11px; border-radius: 3px;
  font-style: normal; font-size: 7px; font-weight: 900; line-height: 1; color: #17200f;
  background: #94a684; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.eb-cell.tier-S .eb-tier { background: linear-gradient(180deg, #ffe08a, #d99c1e); color: #3a2503; }
.eb-cell.tier-A .eb-tier { background: linear-gradient(180deg, #cda6f0, #8452c0); color: #fff; }
.eb-cell.tier-B .eb-tier { background: linear-gradient(180deg, #a6ccf5, #3f76c0); color: #fff; }
.eb-hp {
  display: block; width: 100%; height: 4px; border-radius: 999px; overflow: hidden;
  background: rgba(8, 5, 2, 0.72); box-shadow: inset 0 0 0 0.5px rgba(255, 228, 178, 0.34);
}
.eb-hp > i { display: block; height: 100%; background: linear-gradient(180deg, #9ee88b, #3f9e3a); transition: width 0.18s linear; }
.eb-cell.enemy .eb-hp > i { background: linear-gradient(180deg, #f28d7e, #b63b30); }
.eb-gg { display: block; width: 100%; height: 2.5px; border-radius: 999px; overflow: hidden; background: rgba(8, 5, 2, 0.66); }
.eb-gg > i { display: block; height: 100%; background: linear-gradient(90deg, #f0c357, #fff0bc); transition: width 0.18s linear; }
.eb-cell.ready .eb-gg { box-shadow: 0 0 6px rgba(255, 209, 102, 0.95); }
.eb-cell.ready .eb-gg > i { background: linear-gradient(90deg, #ffe9a8, #fffce8); }
.eb-cell.shielded .eb-hp { box-shadow: inset 0 0 0 1px #7fd4ff, 0 0 7px rgba(127, 212, 255, 0.55); }

/* 치비 전신 — 256×256 정사각 SD를 발판 위에 세운다 */
.eb-sprite {
  flex: 1 1 0; min-height: 0; width: 100%; height: auto;
  object-fit: contain; object-position: 50% 100%;
  transform-origin: 50% 100%; pointer-events: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.62));
  animation: ebIdle 3.6s ease-in-out infinite;
}
.eb-cell.enemy .eb-sprite {
  --flip: -1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 6px rgba(196, 62, 38, 0.3));
}
.eb-cell.boss .eb-sprite {
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.66)) drop-shadow(0 0 10px rgba(255, 132, 42, 0.6));
}
.eb-cell.boss .eb-mark {
  background: radial-gradient(ellipse at 50% 50%, rgba(120, 24, 10, 0.6), rgba(80, 16, 6, 0.22) 56%, rgba(0, 0, 0, 0) 76%);
}
@keyframes ebIdle {
  0%, 100% { transform: scaleX(var(--flip, 1)) translateY(0); }
  50% { transform: scaleX(var(--flip, 1)) translateY(-1.5px); }
}
.eb-fig.cast .eb-sprite { animation: ebCast 0.5s ease-out; }
@keyframes ebCast {
  0% { transform: scaleX(var(--flip, 1)) translateY(0) scale(1); }
  38% { transform: scaleX(var(--flip, 1)) translateY(-1px) scale(1.06, 0.96); }
  72% { transform: scaleX(var(--flip, 1)) translateY(0) scale(0.98, 1.03); }
  100% { transform: scaleX(var(--flip, 1)) translateY(0) scale(1); }
}
.eb-crown { position: absolute; right: 5px; top: 2px; z-index: 4; font-size: 9px; filter: drop-shadow(0 1px 2px #000); }

/* 피격 — 흔들림 · 섬광 · 넉백 */
.eb-fig.hurt { animation: ebHurt 0.36s ease-out; }
@keyframes ebHurt {
  0% { transform: translate(0, 0); }
  22% { transform: translate(2px, var(--ky, -5px)); }
  52% { transform: translate(-1.5px, calc(var(--ky, -5px) * -0.35)); }
  78% { transform: translate(1px, calc(var(--ky, -5px) * 0.2)); }
  100% { transform: translate(0, 0); }
}
.eb-cell.hitflash::before {
  content: ''; position: absolute; left: 50%; top: 46%; width: 94%; height: 64%;
  transform: translate(-50%, -50%); border-radius: 50%; z-index: 6; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), rgba(255, 226, 170, 0.42) 46%, rgba(255, 200, 120, 0) 74%);
  animation: ebFlash 0.3s ease-out forwards; mix-blend-mode: screen;
}
@keyframes ebFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  32% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); }
}

/* 사망 — 옆으로 쓰러지며 반투명으로 사라진다 */
.eb-cell.dead { pointer-events: none; }
.eb-cell.dead .eb-fig { animation: ebFall 0.62s cubic-bezier(0.36, 0, 0.68, 1) forwards; }
.eb-cell.dead .eb-tag { opacity: 0.28; transition: opacity 0.4s; }
.eb-cell.ally.dead .eb-fig { --fall: -78deg; }
@keyframes ebFall {
  0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  42% { transform: translateY(3px) rotate(var(--fall, 78deg)) scale(0.98); opacity: 0.92; }
  100% { transform: translateY(9px) rotate(var(--fall, 78deg)) scale(0.9); opacity: 0.22; filter: grayscale(1); }
}

/* 데미지 팝업 */
.eb-pop {
  position: absolute; left: 50%; top: 27%; z-index: 9; pointer-events: none;
  font-family: var(--serif); font-size: 17px; font-weight: 900; color: #fff6de; letter-spacing: -0.04em;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 1), 0 0 9px rgba(0, 0, 0, 0.9), 0 0 2px #000;
  transform: translateX(-50%); animation: ebPop 0.9s ease-out forwards;
}
.eb-pop.crit { font-size: 24px; color: #ffd166; text-shadow: 0 2px 4px #000, 0 0 12px rgba(255, 170, 40, 0.95); }
.eb-pop.hurt { color: #ff9b8a; }
.eb-pop.heal { color: #9ef0a1; font-size: 17px; }
@keyframes ebPop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
  16% { opacity: 1; transform: translate(-50%, -3px) scale(1.18); }
  40% { transform: translate(-50%, -8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(0.96); }
}

/* 연출 레이어 — 투사체 · 섬광 · 참격 */
.eb-fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }

.eb-proj { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; animation: ebFly 0.34s linear forwards; }
.eb-proj::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  background: inherit; filter: blur(5px); opacity: 0.55;
}
@keyframes ebFly {
  0% { transform: translate(0, 0) rotate(var(--rot, 0deg)) scale(0.72); opacity: 0.45; }
  18% { opacity: 1; }
  100% { transform: translate(var(--px, 0), var(--py, 0)) rotate(var(--rot, 0deg)) scale(1); opacity: 0.95; }
}
.eb-proj.arrow {
  width: 30px; height: 4px; margin: -2px 0 0 -15px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 246, 214, 0) 0%, #fff6dc 52%, #ffd166 100%);
  box-shadow: 0 0 7px rgba(255, 220, 140, 0.9);
}
.eb-proj.flame {
  width: 20px; height: 20px; margin: -10px 0 0 -10px; box-shadow: 0 0 13px rgba(255, 140, 40, 0.9);
  background: radial-gradient(circle at 40% 40%, #fff6d0, #ffb03a 44%, rgba(226, 74, 24, 0.88) 74%, rgba(226, 74, 24, 0));
}
.eb-proj.poison {
  width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; box-shadow: 0 0 12px rgba(110, 220, 110, 0.85);
  background: radial-gradient(circle at 40% 40%, #eaffe0, #7fe06a 44%, rgba(52, 150, 60, 0.9) 74%, rgba(52, 150, 60, 0));
}
.eb-proj.bolt {
  width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; box-shadow: 0 0 14px rgba(140, 210, 255, 0.95);
  background: radial-gradient(circle at 45% 45%, #fff, #a8e2ff 40%, rgba(70, 150, 255, 0.9) 74%, rgba(70, 150, 255, 0));
}
.eb-proj.rock {
  width: 21px; height: 21px; margin: -10.5px 0 0 -10.5px; box-shadow: 0 0 9px rgba(0, 0, 0, 0.55);
  background: radial-gradient(circle at 36% 32%, #d5c6ab, #8b7757 56%, #46361f 100%);
}
.eb-proj.wind {
  box-shadow: 0 0 13px rgba(150, 240, 220, 0.85);
  background: radial-gradient(circle at 45% 45%, #fff, #b8f0e0 48%, rgba(90, 200, 180, 0));
}

.eb-burst { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; animation: ebBurst 0.52s ease-out forwards; }
.eb-burst::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255, 240, 200, 0.9); animation: ebRing 0.48s ease-out forwards;
}
.eb-burst.blade { background: radial-gradient(circle, #fff6dc, rgba(255, 200, 120, 0)); }
.eb-burst.flame { background: radial-gradient(circle, #fff3c8, rgba(255, 130, 40, 0.85) 46%, rgba(210, 60, 20, 0)); }
.eb-burst.flame::after { border-color: rgba(255, 170, 90, 0.9); }
.eb-burst.poison { background: radial-gradient(circle, #eaffe0, rgba(110, 210, 100, 0.85) 48%, rgba(50, 140, 60, 0)); }
.eb-burst.poison::after { border-color: rgba(140, 230, 130, 0.9); }
.eb-burst.bolt { background: radial-gradient(circle, #fff, rgba(150, 210, 255, 0.9) 46%, rgba(80, 140, 255, 0)); }
.eb-burst.bolt::after { border-color: rgba(170, 220, 255, 0.95); }
.eb-burst.rock { background: radial-gradient(circle, #e0d3ba, rgba(140, 120, 90, 0.9) 50%, rgba(70, 55, 35, 0)); }
.eb-burst.wind { background: radial-gradient(circle, #fff, rgba(150, 240, 220, 0.85) 48%, rgba(80, 190, 170, 0)); }
.eb-burst.heal { background: radial-gradient(circle, #f2fff0, rgba(130, 235, 140, 0.85) 48%, rgba(60, 170, 90, 0)); }
.eb-burst.heal::after { border-color: rgba(170, 250, 180, 0.95); }
.eb-burst.big { animation-duration: 0.74s; }
.eb-burst.big::after { border-width: 3px; animation-duration: 0.66s; }
@keyframes ebBurst {
  0% { transform: scale(0.35); opacity: 1; }
  45% { transform: scale(2.4); opacity: 0.95; }
  100% { transform: scale(4.6); opacity: 0; }
}
@keyframes ebRing {
  0% { transform: scale(0.3); opacity: 1; }
  70% { opacity: 0.55; }
  100% { transform: scale(5.2); opacity: 0; }
}

.eb-slash { position: absolute; width: 92px; height: 92px; margin: -46px 0 0 -46px; }
.eb-slash::before, .eb-slash::after {
  content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 5px; margin-top: -2.5px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #fffaea 24%, #fff 56%, #ffd88e 78%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 9px rgba(255, 250, 232, 0.95), 0 0 22px rgba(255, 164, 56, 0.75), 0 1px 3px rgba(110, 55, 8, 0.5);
}
.eb-slash::before { animation: ebSlashA 0.44s ease-out forwards; }
.eb-slash::after { width: 72%; left: 14%; opacity: 0; }
.eb-slash::after { animation: ebSlashB 0.44s ease-out 0.06s forwards; }
@keyframes ebSlashA {
  0% { transform: rotate(-54deg) scaleX(0.08); opacity: 0.1; }
  30% { transform: rotate(-54deg) scaleX(1.14); opacity: 1; }
  100% { transform: rotate(-54deg) scaleX(0.88); opacity: 0; }
}
@keyframes ebSlashB {
  0% { transform: rotate(27deg) scaleX(0.08); opacity: 0.1; }
  34% { transform: rotate(27deg) scaleX(1.02); opacity: 0.92; }
  100% { transform: rotate(27deg) scaleX(0.78); opacity: 0; }
}

/* 필살 — 잠깐 어두워지고 컷인이 훑고 지나간다 */
.eb-dim {
  position: absolute; inset: 0; z-index: 8;
  background: radial-gradient(circle at 50% 46%, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.68));
  animation: ebDim 0.84s ease-out forwards;
}
@keyframes ebDim { 0% { opacity: 0; } 12% { opacity: 1; } 62% { opacity: 1; } 100% { opacity: 0; } }
.eb-cutin {
  position: absolute; left: 0; right: 0; top: 27%; z-index: 12; pointer-events: none;
  display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 9px;
  background: linear-gradient(90deg, rgba(96, 32, 12, 0.95), rgba(38, 20, 8, 0.72) 62%, rgba(20, 10, 4, 0.06));
  border-top: 1.5px solid rgba(255, 214, 150, 0.7); border-bottom: 1.5px solid rgba(255, 214, 150, 0.7);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}
.eb-cutin[hidden] { display: none !important; }
.eb-cutin.enemy {
  flex-direction: row-reverse; text-align: right;
  background: linear-gradient(270deg, rgba(104, 24, 12, 0.95), rgba(40, 16, 8, 0.72) 62%, rgba(20, 8, 4, 0.06));
}
.eb-cutin.show { animation: ebCutin 1s cubic-bezier(0.18, 0.9, 0.25, 1) forwards; }
.eb-cutin.show.enemy { animation-name: ebCutinR; }
.eb-cutin img {
  flex: none; width: 46px; height: 46px; border-radius: 9px; border: 1.5px solid #f2c877;
  object-fit: cover; object-position: 50% 14%; background: #2a1a0b;
  box-shadow: 0 0 13px rgba(255, 176, 70, 0.55);
}
.eb-cutin span { display: block; min-width: 0; }
.eb-cutin b {
  display: block; font-family: var(--serif); font-size: 17px; font-weight: 900; color: #fff6dc; letter-spacing: -0.03em;
  text-shadow: 0 0 12px rgba(255, 150, 40, 0.9), 0 2px 5px #000;
}
.eb-cutin em { display: block; font-style: normal; font-size: 10px; font-weight: 900; color: #ffd88e; letter-spacing: 0.04em; text-shadow: 0 1px 4px #000; }
.eb-cutin.enemy b { color: #ffd8c8; text-shadow: 0 0 12px rgba(210, 60, 30, 0.95), 0 2px 5px #000; }
@keyframes ebCutin {
  0% { transform: translateX(-106%); opacity: 0; }
  14% { transform: translateX(0); opacity: 1; }
  76% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(8%); opacity: 0; }
}
@keyframes ebCutinR {
  0% { transform: translateX(106%); opacity: 0; }
  14% { transform: translateX(0); opacity: 1; }
  76% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-8%); opacity: 0; }
}
.exp-battle.ult .eb-field { animation: ebQuake 0.44s ease-out; }
@keyframes ebQuake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-2px, 1.5px); }
  36% { transform: translate(2px, -1.5px); }
  54% { transform: translate(-1.5px, -1px); }
  72% { transform: translate(1.5px, 1px); }
}

/* 발밑 로그 */
.eb-foot { position: relative; flex: none; display: flex; align-items: center; gap: 8px; z-index: 2; }
#eb-log {
  flex: 1 1 auto; min-width: 0; margin: 0; font-size: 9px; font-weight: 700; color: #d8c19c;
  letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eb-count { flex: none; font-size: 9px; font-weight: 900; color: #ffcf8a; }

/* 좁은 화면 — 칸 높이가 줄어도 발판과 이름표는 붙어 있게 */
@media (max-height: 720px) {
  .eb-field { gap: 6px; }
  .eb-uname { font-size: 7.5px; }
  .eb-tier { width: 10px; height: 10px; font-size: 6.5px; }
  .eb-pop { font-size: 13px; top: 22%; }
  .eb-pop.crit { font-size: 18px; }
  .eb-cutin b { font-size: 15px; }
  .eb-cutin img { width: 38px; height: 38px; }
}

/* 뽑기 결과 아래 안내 */
.exp-pull-hint {
  margin: 7px 0 0; padding: 6px 8px; border-radius: 8px;
  background: rgba(95, 156, 70, 0.12); border: 1px dashed rgba(63, 122, 46, 0.55);
  font-size: 9px; line-height: 1.4; color: #3f5c31; font-weight: 700; letter-spacing: -0.03em;
}
.exp-pull-hint b { color: #8e3627; }

/* 인연 목록 열기 (칩 줄 끝) */
.exp-syn-more {
  align-self: center; margin-left: auto; padding: 2px 8px; border-radius: 999px;
  font-size: 8.5px; font-weight: 900; color: #6b4f1c; letter-spacing: -0.02em;
  background: rgba(255, 252, 244, 0.75); border: 1px solid #c3a97a;
}
.exp-syn-more:active { transform: translateY(1px); }

/* ═══════════════════════════════════════════════════════════════════
   v5.70 (?v=88) — 원정 시나리오 《삼국이분다》 대기실 · 대각선 실시간 난투
   모든 선택자를 #expRoot 아래로 묶어 본편의 .ex-* · .bt-* 규칙과 부딪히지 않게 한다.
   키프레임도 sx* 로 새 이름을 쓴다.
   ═══════════════════════════════════════════════════════════════════ */
#expRoot.ex-root{position:fixed;inset:0;z-index:9000;background:#07080c;overflow:hidden;touch-action:manipulation;user-select:none;-webkit-user-select:none}
#expRoot .ex-stage{position:absolute;left:50%;top:50%;width:390px;height:844px;transform-origin:center center;overflow:hidden;background:#111;font-family:'Noto Sans KR',system-ui,sans-serif;color:#fff}
#expRoot .ex-stage button{font-family:inherit;cursor:pointer;border:0;color:#fff}
#expRoot .ex-stage img{-webkit-user-drag:none;pointer-events:none}
#expRoot .ex-loading,#expRoot .ex-empty{position:absolute;left:0;right:0;top:46%;text-align:center;font-size:13px;color:#e6c476}

/* ---- 대기실 ---- */
#expRoot .ex-room,#expRoot .bt{position:absolute;inset:0}
#expRoot .ex-bg{position:absolute;inset:0;background:url(../assets/title_bg.webp) center/cover no-repeat,#2a2118}
#expRoot .ex-bg::after{content:"";position:absolute;inset:0;background:linear-gradient(#000a 0,#0000 20%,#0006 46%,#000b 68%,#000d 100%)}
#expRoot .ex-top{position:absolute;left:0;right:0;top:0;height:52px;display:flex;align-items:center;gap:6px;padding:0 8px;background:linear-gradient(#000d,#0000);z-index:30}
#expRoot .ex-back{background:#0008;border:1px solid #fff4;border-radius:14px;padding:5px 9px;font-size:12px}
#expRoot .ex-act{flex:1;text-align:center;font-weight:800;font-size:13px;color:#ffe9a8;text-shadow:0 1px 3px #000}
#expRoot .ex-pw,#expRoot .ex-merit{background:#000a;border:1px solid #ffd76a66;border-radius:12px;padding:4px 8px;font-size:12px;font-weight:700;color:#ffd76a;white-space:nowrap}
#expRoot .ex-goal{position:absolute;left:8px;top:60px;width:152px;padding:8px 10px;border-radius:10px;background:linear-gradient(#3b2a14ee,#1d140aee);border:1px solid #c9a24d;z-index:20;box-shadow:0 2px 8px #0008}
#expRoot .ex-goal .g1{font-size:10px;color:#e6c476}
#expRoot .ex-goal .g2{font-size:14px;font-weight:800;margin:2px 0}
#expRoot .ex-goal .g3{font-size:12px;color:#ffd76a}
#expRoot .ex-goal .g4{font-size:10px;color:#9fe29f;margin-top:2px}
#expRoot .ex-side{position:absolute;right:8px;top:60px;display:flex;flex-direction:column;gap:6px;z-index:20}
#expRoot .ex-sbtn{width:62px;height:54px;border-radius:12px;background:linear-gradient(#4a3a22ee,#241a0cee);border:1px solid #c9a24d;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:11px;gap:1px}
#expRoot .ex-sbtn i{font-style:normal;font-size:19px}
#expRoot .ex-sbtn:active,#expRoot .ex-dock button:active,#expRoot .ex-go:active{transform:scale(.95)}
#expRoot .ex-yard{position:absolute;inset:0;z-index:10}
#expRoot .ex-yard::before{content:"";position:absolute;left:0;right:0;top:300px;bottom:120px;background:linear-gradient(#0000,#0007 32%,#000c 78%,#0009);pointer-events:none}
#expRoot .ex-char{position:absolute;width:120px;height:166px;margin:-142px 0 0 -60px;text-align:center;animation:sxBob 1.8s ease-in-out infinite;cursor:pointer}
#expRoot .ex-char::before{content:"";position:absolute;left:50%;bottom:14px;width:92px;height:20px;margin-left:-46px;border-radius:50%;background:radial-gradient(#000c,#0000 72%)}
@keyframes sxBob{50%{transform:translateY(-4px)}}
#expRoot .ex-pt{position:relative}
#expRoot .ex-pt img{width:100%;height:100%;object-fit:contain;display:block}
#expRoot .ex-pt.noimg{display:flex;align-items:center;justify-content:center;background:#443;border-radius:50%;font-weight:900;font-size:22px}
#expRoot .ex-chibi{width:116px;height:126px;margin:38px auto 0;filter:drop-shadow(0 4px 6px #0009) drop-shadow(0 0 10px #ffcf7a33)}
#expRoot .ex-badge{position:absolute;left:50%;top:0;transform:translateX(-50%);margin:0;padding:2px 7px;border-radius:9px;background:#000b;border:1px solid #ffd76a88;font-size:11px;line-height:1.25;white-space:nowrap}
#expRoot .ex-badge b{color:#ffd76a;font-size:10px}
#expRoot .ex-syn{position:absolute;left:0;right:0;bottom:158px;display:flex;flex-wrap:wrap;gap:5px;justify-content:center;padding:0 10px;z-index:20}
#expRoot .ex-chip{background:#000b;border:1px solid #6ec6ff;border-radius:11px;padding:3px 8px;font-size:11px}
#expRoot .ex-chip em{font-style:normal;color:#8ff;margin-left:3px}
#expRoot .ex-chip.bond{border-color:#ff8fd0}
#expRoot .ex-chip.bond em{color:#ffb8e6}
#expRoot .ex-chip.off{border-color:#666;color:#aaa}
#expRoot .ex-go{position:absolute;left:22px;right:22px;bottom:78px;height:64px;border-radius:32px;font-size:22px;font-weight:900;letter-spacing:1px;background:linear-gradient(#ff7a3d,#c4200f);border:2px solid #ffd76a;box-shadow:0 4px 14px #000a,inset 0 2px 0 #fff5;z-index:25;text-shadow:0 2px 3px #000a;animation:sxPulse 1.6s infinite}
@keyframes sxPulse{50%{box-shadow:0 4px 22px #ff7a3daa,inset 0 2px 0 #fff5}}
#expRoot .ex-dock{position:absolute;left:0;right:0;bottom:0;height:68px;display:grid;grid-template-columns:repeat(4,1fr);background:linear-gradient(#1b140a,#0b0805);border-top:2px solid #c9a24d;z-index:30}
#expRoot .ex-dock button{background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;gap:2px}
#expRoot .ex-dock i{font-style:normal;font-size:22px}

/* ---- 모달 공통 ---- */
#expRoot .ex-modal{position:absolute;inset:0;background:#000b;z-index:200;display:flex;align-items:flex-end;justify-content:center}
#expRoot .ex-mbox{width:100%;max-height:78%;background:linear-gradient(#2b2013,#150f08);border-top:2px solid #c9a24d;border-radius:18px 18px 0 0;display:flex;flex-direction:column;animation:sxUp .2s}
#expRoot .ex-mbox.tall{height:78%}
#expRoot .ex-mbox.res{border-radius:18px;margin:auto 14px;width:auto;max-height:80%;border:2px solid #c9a24d}
#expRoot .ex-modal:has(.res){align-items:center}
@keyframes sxUp{from{transform:translateY(40px);opacity:0}}
#expRoot .ex-mh{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;font-size:16px;color:#ffe9a8;border-bottom:1px solid #fff2}
#expRoot .ex-mx{background:#0006;border-radius:50%;width:28px;height:28px}
#expRoot .ex-list,#expRoot .ex-unit,#expRoot .ex-form,#expRoot .ex-result{padding:10px 12px 18px;overflow-y:auto}
#expRoot .l-hd{font-size:12px;color:#e6c476;margin:4px 0 8px}
#expRoot .l-row{display:flex;align-items:center;gap:8px;padding:7px 8px;margin-bottom:6px;border-radius:10px;background:#ffffff0f;border:1px solid #fff1}
#expRoot .l-row.in{border-color:#ffd76a;background:#ffd76a18}
#expRoot .l-row.lock{opacity:.45}
#expRoot .l-row.clr .s-st{color:#9fe29f}
#expRoot .l-pt{width:42px;height:46px;flex:none}
#expRoot .l-mid{flex:1;display:flex;flex-direction:column;font-size:14px;min-width:0}
#expRoot .l-mid small{color:#c9b98e;font-size:11px}
#expRoot .s-no{width:28px;height:28px;border-radius:50%;background:#c9a24d;color:#111;font-weight:900;display:flex;align-items:center;justify-content:center;flex:none}
#expRoot .s-st{font-size:12px;color:#ffd76a;white-space:nowrap}
#expRoot .ex-btn{flex:1;height:44px;border-radius:12px;background:linear-gradient(#4a6a9a,#26385a);font-size:14px;font-weight:800;border:1px solid #9cc0ff88}
#expRoot .ex-btn.gold{background:linear-gradient(#e0a93a,#9a6a12);border-color:#ffe08a}
#expRoot .ex-btn small{display:block;font-size:10px;font-weight:500;opacity:.9}
#expRoot .ex-mini{width:38px;height:30px;border-radius:8px;background:#335d99;font-size:12px;font-weight:800}
#expRoot .ex-mini.gold{background:#b98a1e}
#expRoot .u-head{display:flex;gap:12px;align-items:center}
#expRoot .u-pt{width:96px;height:108px;flex:none}
#expRoot .u-info{flex:1}
#expRoot .u-n{font-size:18px;font-weight:800}
#expRoot .u-n small{font-size:11px;color:#c9b98e;font-weight:400}
#expRoot .u-s{color:#ffd76a;margin:3px 0}
#expRoot .u-bar{height:8px;background:#0008;border-radius:4px;overflow:hidden}
#expRoot .u-bar i{display:block;height:100%;background:linear-gradient(90deg,#5ee0ff,#2a7fff)}
#expRoot .u-x{font-size:10px;color:#aaa;margin-top:2px}
#expRoot .u-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:12px 0}
#expRoot .u-stats div{background:#0006;border-radius:10px;padding:7px;text-align:center}
#expRoot .u-stats span{display:block;font-size:11px;color:#c9b98e}
#expRoot .u-stats b{font-size:16px}
#expRoot .u-skill{background:#0006;border-radius:10px;padding:8px 10px;font-size:13px;margin-bottom:10px}
#expRoot .u-skill b{color:#ffd76a}
#expRoot .u-skill small{color:#c9b98e;font-size:10px}
#expRoot .u-equip{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:12px}
#expRoot .u-eq{background:#ffffff0d;border:1px dashed #fff4;border-radius:10px;padding:6px 2px;text-align:center;font-size:10px;color:#999;cursor:pointer;overflow:hidden}
#expRoot .u-eq.on{border-style:solid;border-color:#ffd76a;color:#fff}
#expRoot .u-eq i{display:block;font-style:normal;font-size:20px}
#expRoot .u-eq span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#expRoot .u-btns{display:flex;gap:8px;margin-top:6px}
#expRoot .u-note{font-size:11px;color:#c9b98e;text-align:center;margin-top:10px;line-height:1.5}
#expRoot .u-note.big{font-size:13px;margin:10px 0;color:#ffe9a8}
#expRoot .f-slots{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-bottom:10px}
#expRoot .f-slot{aspect-ratio:1/1.15;background:#0006;border:2px dashed #fff4;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px}
#expRoot .f-slot.sel{border-color:#ffd76a;border-style:solid}
#expRoot .f-slot em{font-style:normal;font-size:22px;color:#777}
#expRoot .f-pt{width:46px;height:52px}
#expRoot .f-bench{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;max-height:300px;overflow-y:auto}
#expRoot .f-card{background:#ffffff0f;border:1px solid #fff2;border-radius:10px;padding:5px 2px;display:flex;flex-direction:column;align-items:center;font-size:10px}
#expRoot .f-card.in{border-color:#ffd76a;background:#ffd76a22}
#expRoot .r-t{text-align:center;font-size:30px;font-weight:900;margin:6px 0}
#expRoot .r-t.win{color:#ffd76a}
#expRoot .r-t.lose{color:#ff8a8a}
#expRoot .r-l{text-align:center;font-size:13px;color:#e6c476}
#expRoot .r-h{text-align:center;color:#8ff;font-weight:800;margin-top:6px}
#expRoot .r-row{display:flex;justify-content:space-between;padding:6px 4px;border-bottom:1px solid #fff1;font-size:13px}
#expRoot .r-row b{color:#ffd76a}
#expRoot .ex-toast{position:absolute;left:50%;top:120px;transform:translateX(-50%);background:#000d;border:1px solid #ffd76a;border-radius:16px;padding:8px 16px;font-size:13px;z-index:500;animation:sxFade 1.7s forwards;white-space:nowrap}
@keyframes sxFade{80%{opacity:1}to{opacity:0}}

/* ---- 소환 / 보물 ---- */
#expRoot .sx-rate{font-size:10px;color:#c9b98e;text-align:center;margin-bottom:6px;line-height:1.5}
#expRoot .sx-rate em{font-style:normal;color:#ffd76a}
#expRoot .sx-wallet{text-align:center;font-size:12px;color:#ffe9a8;margin-bottom:8px}
#expRoot .sx-wallet b{color:#ffd76a}
#expRoot .sx-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin:6px 0 10px}
#expRoot .sx-card{background:#0007;border:1px solid #fff3;border-radius:9px;padding:4px 2px;text-align:center;font-size:10px;overflow:hidden}
#expRoot .sx-card.t-S{border-color:#e05a4a;background:#e05a4a22}
#expRoot .sx-card.t-A{border-color:#a07be0;background:#a07be022}
#expRoot .sx-card.t-B{border-color:#5a8ae0;background:#5a8ae022}
#expRoot .sx-card b{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#expRoot .sx-card em{font-style:normal;color:#ffd76a;font-size:10px}
#expRoot .sx-pt{width:52px;height:56px;margin:0 auto}
#expRoot .sx-ic{font-size:26px;line-height:1.2}
#expRoot .sx-gear{display:flex;align-items:center;gap:8px;padding:7px 8px;margin-bottom:6px;border-radius:10px;background:#ffffff0f;border:1px solid #fff1;cursor:pointer}
#expRoot .sx-gear.on{border-color:#ffd76a;background:#ffd76a18}
#expRoot .sx-gic{font-size:20px}
#expRoot .sx-gmid{flex:1;display:flex;flex-direction:column;min-width:0}
#expRoot .sx-gmid b{font-size:13px}
#expRoot .sx-gmid small{font-size:10px;color:#c9b98e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#expRoot .sx-gs{font-size:11px;color:#ffd76a;white-space:nowrap}

/* ---- 전투 ---- */
#expRoot .bt-bg{position:absolute;inset:0;background:url(../assets/duel_arena_bg.webp) center/cover no-repeat,#352a1c}
#expRoot .bt-bg::after{content:"";position:absolute;inset:0;background:radial-gradient(#0000 45%,#000a 100%)}
#expRoot .bt-hud{position:absolute;left:0;right:0;top:0;height:64px;padding:8px 8px 0;display:grid;grid-template-columns:1fr 54px 1fr;gap:6px;align-items:start;background:linear-gradient(#000d,#0000);z-index:300}
#expRoot .bt-side small{font-size:10px;color:#ddd}
#expRoot .bt-side.r{text-align:right}
#expRoot .bt-bar{height:14px;background:#000a;border:1px solid #fff5;border-radius:7px;overflow:hidden}
#expRoot .bt-bar i{display:block;height:100%;width:100%;transition:width .15s}
#expRoot .bt-bar.a i{background:linear-gradient(#6fe27a,#1d9a3a)}
#expRoot .bt-bar.e i{background:linear-gradient(#ff7a7a,#b21818);margin-left:auto}
#expRoot .bt-time{text-align:center;font-size:22px;font-weight:900;color:#ffe9a8;text-shadow:0 2px 4px #000}
#expRoot .bt-field{position:absolute;inset:0;z-index:100;overflow:hidden}
#expRoot .bt-u{position:absolute;left:0;top:0;width:58px;height:58px;will-change:transform}
#expRoot .bt-u img{width:58px;height:58px;object-fit:contain;display:block;filter:drop-shadow(0 4px 3px #0009);transition:transform .15s}
#expRoot .bt-u.t1 img{transform:scaleX(-1)}
#expRoot .bt-u.boss{width:68px}
#expRoot .bt-u.boss img{width:68px;height:68px;margin:-10px 0 0 -5px}
#expRoot .bt-u.noimg::before{content:attr(data-ch);position:absolute;inset:6px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:900;background:#3a5a9a}
#expRoot .bt-u.t1.noimg::before{background:#9a3a3a}
#expRoot .bt-u.lunge img{transform:translateX(14px) scale(1.12)}
#expRoot .bt-u.t1.lunge img{transform:scaleX(-1) translateX(14px) scale(1.12)}
#expRoot .bt-u.hurt img{filter:brightness(2.2) drop-shadow(0 0 4px #f44)}
#expRoot .bt-u.cast img{filter:drop-shadow(0 0 10px #ffe35a) brightness(1.4)}
#expRoot .bt-u.dead{opacity:0;transition:opacity .5s;pointer-events:none}
#expRoot .bt-u.dead img{transform:translateY(8px) rotate(80deg)}
#expRoot .bt-hp{position:absolute;left:6px;right:6px;top:-6px;height:5px;background:#000a;border-radius:3px;overflow:hidden}
#expRoot .bt-hp i{display:block;height:100%;width:100%}
#expRoot .bt-u.t0 .bt-hp i{background:#58e06a}
#expRoot .bt-u.t1 .bt-hp i{background:#ff5252}
#expRoot .bt-proj{position:absolute;left:0;top:0;width:16px;height:16px}
#expRoot .bt-proj.arrow{height:3px;width:22px;margin-top:6px;background:linear-gradient(90deg,#0000,#ffe9a8);border-radius:2px}
#expRoot .bt-proj.orb{border-radius:50%;background:radial-gradient(#fff,#7ad7ff 50%,#0000 72%);box-shadow:0 0 10px #7ad7ff}
#expRoot .bt-fx{position:absolute;pointer-events:none;transform:translate(-50%,-50%)}
#expRoot .bt-fx.slash{width:52px;height:6px;background:linear-gradient(90deg,#0000,#fff,#0000);border-radius:4px;animation:sxSlash .3s forwards}
@keyframes sxSlash{from{transform:translate(-50%,-50%) rotate(-40deg) scaleX(.2);opacity:1}to{transform:translate(-50%,-50%) rotate(-40deg) scaleX(1.4);opacity:0}}
#expRoot .bt-fx.flash{width:46px;height:46px;border-radius:50%;background:radial-gradient(#fff,#8fe0ff88 55%,#0000 72%);animation:sxFlash .3s forwards}
@keyframes sxFlash{to{transform:translate(-50%,-50%) scale(1.8);opacity:0}}
#expRoot .bt-fx.big{width:150px;height:150px;border-radius:50%;background:radial-gradient(#fff9,#ffb43a88 45%,#0000 70%);animation:sxFlash .45s forwards}
#expRoot .bt-fx.bolt{width:8px;height:90px;margin-top:-50px;background:linear-gradient(#fff,#ffe35a,#0000);animation:sxBolt .35s forwards}
@keyframes sxBolt{from{opacity:1;transform:translate(-50%,-50%) scaleY(.3)}to{opacity:0;transform:translate(-50%,-50%) scaleY(1.2)}}
#expRoot .bt-pop{position:absolute;transform:translateX(-50%);font-weight:900;font-size:16px;color:#fff;text-shadow:-1px -1px #000,1px 1px #000,0 0 6px #000;animation:sxPop .8s forwards;pointer-events:none;z-index:9999}
#expRoot .bt-pop.foe{color:#ff8a8a}
#expRoot .bt-pop.heal{color:#7dff9a}
@keyframes sxPop{to{transform:translate(-50%,-34px);opacity:0}}
#expRoot .bt-banner{position:absolute;left:50%;top:92px;transform:translateX(-50%);padding:5px 16px;border-radius:14px;background:#000c;border:1px solid #ffd76a;color:#ffe9a8;font-weight:800;font-size:14px;z-index:400;white-space:nowrap;animation:sxFade 1.15s forwards}
#expRoot .bt-banner.foe{border-color:#f66;color:#faa}
#expRoot .bt-ctl{position:absolute;left:0;right:0;bottom:104px;display:flex;justify-content:center;gap:6px;z-index:300}
#expRoot .bt-ctl button{height:32px;padding:0 12px;border-radius:16px;background:#000b;border:1px solid #fff5;font-size:12px;font-weight:700}
#expRoot .bt-ctl .spd.hot{background:#b9801e;border-color:#ffe08a}
#expRoot .bt-ctl .auto.on{background:#2a7a3a;border-color:#8f8}
#expRoot .bt-ctl .out{background:#5a1f1f}
#expRoot .bt-cards{position:absolute;left:0;right:0;bottom:0;height:98px;padding:8px 6px;display:grid;grid-template-columns:repeat(5,1fr);gap:5px;background:linear-gradient(#0000,#000d 30%);z-index:300}
#expRoot .bt-card{position:relative;border-radius:10px;background:#1b140acc;border:2px solid #6b5a38;overflow:hidden;padding-top:4px}
#expRoot .bt-card .c-pt{width:52px;height:50px;margin:0 auto}
#expRoot .bt-card .c-nm{position:absolute;left:0;right:0;top:2px;text-align:center;font-size:9px;color:#ffe9a8;text-shadow:0 1px 2px #000;pointer-events:none}
#expRoot .c-hp,#expRoot .c-sk{position:absolute;left:3px;right:3px;height:6px;background:#000a;border-radius:3px;overflow:hidden}
#expRoot .c-hp{bottom:11px}
#expRoot .c-sk{bottom:3px}
#expRoot .c-hp i{display:block;height:100%;width:100%;background:#58e06a}
#expRoot .c-sk i{display:block;height:100%;width:0;background:#ffd21a}
#expRoot .bt-card.ready{border-color:#ffd21a;animation:sxReady .6s infinite alternate;cursor:pointer}
@keyframes sxReady{from{box-shadow:0 0 0 #ffd21a}to{box-shadow:0 0 14px 3px #ffd21a;filter:brightness(1.35)}}
#expRoot .bt-card.dead{filter:grayscale(1) brightness(.5);pointer-events:none}

/* ═══════════ v5.72 — 세력일람 소속 장수 · 성벽 카드 제목 ═══════════ */
/* 세력일람 펼침 영역 — 가진 성·병력 아래에 소속 장수 이름 배지 */
.fl-detail .fl-cities { display: inline; }
.fh-wrap { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(150, 120, 60, 0.45); }
.fh-title { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; font-size: 9.5px; font-weight: 800; color: #7a5a1c; }
.fh-title small { color: #8a7448; font-weight: 800; }
.fh-title em { margin-left: auto; font-style: normal; font-size: 8.5px; color: #a08b5e; }
.fh-list { display: flex; flex-wrap: wrap; gap: 4px; }
.fh-badge {
  appearance: none; display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
  border: 1px solid #c9a24e; border-radius: 999px; padding: 3px 7px;
  background: linear-gradient(180deg, #fffaf0, #f3e6c8); color: #3a2d15;
  font: inherit; font-size: 9.5px; font-weight: 800; line-height: 1.1; white-space: nowrap;
}
.fh-badge i { font-style: normal; font-size: 8px; font-weight: 900; color: #8a6a26; background: rgba(184, 134, 47, 0.16); border-radius: 999px; padding: 0 4px; }
.fh-badge.tS { border-color: #cf5145; }
.fh-badge.tA { border-color: #9b62c8; }
.fh-badge.tB { border-color: #4a83d6; }
.fh-badge.tC { border-color: #5c9c6e; }
.fh-badge:active { transform: scale(0.96); background: #fff3d6; }
.fh-empty { font-size: 9px; color: #a3906a; }
/* 다른 세력 장수 상세창 — 이름 옆 등급 배지 */
.fh-tier { font-style: normal; font-size: 10px; font-weight: 900; color: #fff6e0; background: #8a6a34; border-radius: 7px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.fh-tier.tS { background: linear-gradient(180deg, #e8453a, #b8201a); }
.fh-tier.tA { background: linear-gradient(180deg, #9b62c8, #7742a3); }
.fh-tier.tB { background: linear-gradient(180deg, #3d7ddb, #2559ab); }
.fh-tier.tC { background: linear-gradient(180deg, #4f9c66, #33764a); }
.fh-note { margin: 6px 0 0; font-size: 9px; color: #8a7448; text-align: center; }

/* 내정 시설 카드 — '성벽' + [계략방어 67%] + Lv.5 가 잘리지 않게
   (예전: .sc-top 이 한 줄 고정 + b 에 ellipsis 라서 제목이 '성..' 으로 깎였다)
   제목과 Lv 는 첫 줄, 배지는 폭이 모자라면 다음 줄로 내려가 카드가 조금 높아진다 */
.slot-grid .slot-card .sc-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1px 3px; min-width: 0;
  /* 시나리오 화면의 전역 .sc-top(grid + padding 10px 14px)을 물려받아 제목 칸이 44px로 눌리던 것 */
  padding: 0; grid-template-columns: none;
}
.slot-grid .slot-card .sc-top b {
  flex: 0 0 auto; min-width: max-content; max-width: 100%;
  white-space: nowrap; overflow: visible; text-overflow: clip; line-height: 1.2;
}
/* 순서: 제목(1) · Lv(2) · 배지(3) — 첫 줄에 제목과 Lv, 배지는 둘째 줄로 내려간다
   (배지가 제목 사이에 끼면 48px 폭에서 세 줄로 늘어나 카드가 길쭉해졌다) */
.slot-grid .slot-card .sc-top b { order: 1; }
.slot-grid .slot-card .sc-top em { order: 2; }
.slot-grid .slot-card .sc-top .sc-craft { order: 3; flex: 0 0 auto; margin-left: 0; line-height: 1.35; max-width: 100%; }
.slot-grid .slot-card .sc-top em { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
@media (max-width: 430px) {
  /* v5.73 — 좁은 화면에서도 카드가 2열 그리드 칸 폭을 그대로 채운다(104px 고정 폭 원복)
     제목·배지는 .sc-top 의 flex-wrap 이 다음 줄로 내려 주므로 넘치지 않는다 */
  .slot-grid .slot-card { width: 100%; }
  .slot-grid .slot-card .sc-main b { font-size: 9.5px; }
}

/* ═══════════ v5.74 (?v=92) — 원정 등급색 · 필살기 · 장비 · 인연 24종 ═══════════
   전부 #expRoot 안에서만 적용 — 본편 화면은 건드리지 않는다. */

/* 1) 초상화 등급 테두리 4색: S 빨강 · A 보라 · B 파랑 · C 초록 (본편과 같은 값) */
#expRoot{--g-S:#c42828;--g-A:#7742a3;--g-B:#2559ab;--g-C:#33764a}
#expRoot [data-grade="S"]{--gc:var(--g-S)}
#expRoot [data-grade="A"]{--gc:var(--g-A)}
#expRoot [data-grade="B"]{--gc:var(--g-B)}
#expRoot [data-grade="C"]{--gc:var(--g-C)}
#expRoot :is(.ex-pt,.l-pt,.u-pt,.f-pt,.c-pt,.sx-pt,.exp-portrait,.exp-pt,.codex-pt,.gacha-pt,.gacha-card .pt,.cutin-pt,.ex-cutin .pt,.xb-pt)[data-grade]{
  border:2px solid var(--gc);border-radius:10px;box-shadow:0 0 0 1px #000a,0 0 8px color-mix(in srgb,var(--gc) 70%,transparent);
  box-sizing:border-box;background:#0004}
/* 대기실 치비 전신은 테두리 대신 발밑 이름 배지에 링 */
#expRoot .ex-chibi[data-grade]{border:0;box-shadow:none;background:none;border-radius:0}
#expRoot .ex-badge[data-grade]{border:2px solid var(--gc);box-shadow:0 0 8px color-mix(in srgb,var(--gc) 65%,transparent)}
/* 필살기 컷인 초상화는 조금 더 굵게 */
#expRoot :is(.cutin-pt,.ex-cutin .pt)[data-grade]{border-width:3px;box-shadow:0 0 18px var(--gc),0 0 0 2px #000}

/* 2) 장수 상세창 — 필살기 설명 블록 */
#expRoot .u-skillbox{margin-bottom:10px}
#expRoot .xs-skill{background:#0007;border:1px solid #ffd76a55;border-radius:10px;padding:8px 10px}
#expRoot .xs-hd{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#expRoot .xs-hd b{color:#ffd76a;font-size:14px}
#expRoot .xs-hd em{font-style:normal;font-size:10px;padding:1px 6px;border-radius:8px;background:#ffd76a22;border:1px solid #ffd76a66;color:#ffe9a8}
#expRoot .xs-ic{font-size:16px}
#expRoot .xs-ds{margin-top:5px;font-size:12px;line-height:1.5;color:#fff;word-break:keep-all}
#expRoot .xs-ft{margin-top:4px;font-size:10px;color:#9a8e6e}
#expRoot .xs-skill[data-type="heal"] .xs-hd b,#expRoot .xs-skill[data-type="buff"] .xs-hd b{color:#8fffb0}
#expRoot .xs-skill[data-type="fire"] .xs-hd b{color:#ff9a5a}
#expRoot .xs-skill[data-type="bolt"] .xs-hd b,#expRoot .xs-skill[data-type="control"] .xs-hd b{color:#9fd8ff}

/* 3) 장비 카드 · 장착 슬롯 — 핵심 효과 칩 2개 */
#expRoot .xt-card{position:relative;padding:8px 10px;border-radius:10px;background:#ffffff0f;border:2px solid var(--gc,#555)}
#expRoot .xt-top{display:flex;align-items:center;gap:6px}
#expRoot .xt-top b{flex:1;font-size:13px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}
#expRoot .xt-top em{font-style:normal;font-weight:900;font-size:11px;padding:1px 7px;border-radius:8px;background:var(--gc,#555);color:#fff}
#expRoot .xt-slot{font-size:10px;color:#c9b98e;margin:2px 0 4px}
#expRoot .xt-fx{display:flex;flex-wrap:wrap;gap:3px 5px}
#expRoot .xt-fx span{font-size:10.5px;background:#0006;border-radius:8px;padding:2px 6px;white-space:nowrap;color:#fff}
#expRoot .xt-fx b{color:#ffd76a}
#expRoot .sx-card .xt-fx{justify-content:center;margin-top:2px}
#expRoot .sx-card .xt-fx span{font-size:9px;padding:1px 4px}
#expRoot .sx-tg{font-style:normal;font-size:9.5px;font-weight:900;color:#fff;background:var(--gc,#666);border-radius:6px;padding:0 4px;vertical-align:1px}
#expRoot .sx-gear .xt-fx{margin-top:2px}
#expRoot .sx-gear .xt-fx span{font-size:10px;padding:1px 6px}
/* 장착 슬롯 셀 — 등급색 테두리 + 효과 칩 */
#expRoot .u-eq.on[data-grade]{border-color:var(--gc);border-style:solid}
#expRoot .u-eq small{display:block;color:#ffd76a;font-size:9px;line-height:1.3;white-space:nowrap;overflow:hidden}

/* 4) 인연 도감 — 완성 강조 · 보유 ✓ · 효과 · 출진 중 배지 */
#expRoot .xb-sum{font-size:12px;color:#e6c476;margin-bottom:8px}
#expRoot .xb-sum b{color:#ffd76a;font-size:15px}
#expRoot .xb-card{padding:9px 10px;margin-bottom:8px;border-radius:12px;background:#ffffff0c;border:1px solid #fff2;opacity:.92}
#expRoot .xb-card.done{opacity:1;background:linear-gradient(#ffd76a26,#ffd76a0c);border:2px solid #ffd76a;box-shadow:0 0 12px #ffd76a55}
#expRoot .xb-card.live{border-color:#8fffb0}
#expRoot .xb-card.done.live{border-color:#ffd76a}
#expRoot .xb-hd{display:flex;align-items:center;gap:6px}
#expRoot .xb-hd b{font-size:14px;color:#fff}
#expRoot .xb-hd small{font-size:10px;color:#c9b98e;border:1px solid #fff3;border-radius:7px;padding:0 5px}
#expRoot .xb-st{margin-left:auto;font-size:12px;color:#aaa}
#expRoot .xb-card.done .xb-st{color:#ffd76a;font-weight:800}
#expRoot .xb-ds{font-size:11px;color:#b9ad8a;margin:3px 0}
#expRoot .xb-fx{display:flex;flex-wrap:wrap;gap:4px 6px;margin:5px 0}
#expRoot .xb-fx span{font-size:11px;background:#0006;border-radius:8px;padding:2px 7px;white-space:nowrap;color:#fff}
#expRoot .xb-fx b{color:#8ff}
#expRoot .xb-fx .xb-need{color:#c9b98e}
#expRoot .xb-fx .xb-live{background:#2a7a3a;color:#fff;font-weight:700}
#expRoot .xb-ms{display:flex;flex-wrap:wrap;gap:4px}
#expRoot .xb-m{font-size:11px;padding:3px 8px;border-radius:10px;background:#0005;border:1px solid #fff2;color:#888}
#expRoot .xb-m.own{color:#fff;border-color:#8fffb0;background:#1f5a32aa}

/* 5) 전투 — 기절 · 화상 · 감속 · 버프 · 치명타 · 필살기 컷인 */
#expRoot .bt-u.stun img{filter:grayscale(.7) brightness(.8)}
#expRoot .bt-u.stun::after{content:"💫";position:absolute;left:50%;top:-12px;transform:translateX(-50%);font-size:14px;animation:sxSpin 1s linear infinite}
#expRoot .bt-u.burn img{filter:brightness(1.25) sepia(.5) hue-rotate(-20deg)}
#expRoot .bt-u.buffed::before{content:"⬆";position:absolute;right:-2px;top:-10px;color:#8fffb0;font-size:13px;font-weight:900;text-shadow:0 0 6px #000}
#expRoot .bt-pop.crit{color:#ffd21a;font-size:19px}
@keyframes sxSpin{to{transform:translateX(-50%) rotate(360deg)}}
#expRoot .bt-fx.fire{width:34px;height:34px;border-radius:50%;background:radial-gradient(#fff6b0,#ff7a2a66 45%,#0000 72%);animation:sxFlash .35s forwards}
#expRoot .bt-fx.stun{width:40px;height:40px;border-radius:50%;background:radial-gradient(#fff,#ffe35a88 45%,#0000 72%);animation:sxFlash .4s forwards}
#expRoot .bt-fx.slow{width:46px;height:46px;border-radius:50%;border:2px solid #9fd8ff;background:radial-gradient(#9fd8ff44,#0000 70%);animation:sxFlash .4s forwards}
#expRoot .ex-cutin{position:absolute;left:0;right:0;top:74px;display:flex;align-items:center;gap:10px;justify-content:center;z-index:190;pointer-events:none;animation:sxCutin 1s forwards}
#expRoot .ex-cutin .cutin-pt{width:74px;height:84px;flex:none;background:#0006;border-radius:10px}
#expRoot .cu-tx{max-width:230px;display:flex;flex-direction:column;gap:2px;text-shadow:0 2px 4px #000}
#expRoot .cu-tx b{font-size:17px;color:#ffe9a8}
#expRoot .cu-tx em{font-style:normal;font-size:12px;font-weight:900;color:#ffd76a}
#expRoot .cu-tx small{font-size:10px;color:#e9e2cf;line-height:1.35;word-break:keep-all}
@keyframes sxCutin{0%{opacity:0;transform:translateX(-24px)}12%{opacity:1;transform:none}80%{opacity:1}100%{opacity:0;transform:translateX(18px)}}

/* ══════════════════════════════════════════════════════════════
   v5.75 — 총도독(군단) · 보물 세트 · 실플레이 버그 5종
   ══════════════════════════════════════════════════════════════ */

/* ① 출진 편성 — 고른 줄만 ✓·활성, 미선택은 ○·흐림 */
.hero-pick.off { opacity: 0.58; background: rgba(236, 226, 203, 0.55); border-style: dashed; }
.hero-pick.off .hp-main b { color: #6b5830; }
.hero-pick.off .hp-check { color: #a8946a; border-style: dashed; border-color: #b99a5e; }
.hero-pick.off .hp-count { background: #efe4cc; color: #9a8a66; border-style: dotted; }
.hero-pick.off .hp-step button { opacity: 0.4; }
.hero-pick .hp-step button:disabled, .hero-pick .hp-count:disabled { cursor: not-allowed; }
.hero-pick.on .hp-check { font-weight: 900; }

/* v5.80 — 이번 달 행동을 마친 장수: 목록에 남지만 아예 고를 수 없다 */
.hero-pick.locked { opacity: 0.5; border-color: #b3a894; border-style: dashed; cursor: not-allowed;
  background: repeating-linear-gradient(135deg, rgba(214, 205, 189, 0.55) 0 6px, rgba(230, 222, 208, 0.55) 6px 12px); }
.hero-pick.locked .hp-main b { color: #6b6455; }
.hero-pick.locked .hp-main span { color: #8a8377; }
.hero-pick.locked img { filter: grayscale(0.85); }
.hero-pick.locked .hp-duty { background: #b9b1a1; color: #403c35; }
.hero-pick.locked .hp-check { color: #8b8475; border-style: dotted; border-color: #a89f8d; }
.hero-pick.locked .hp-step button, .hero-pick.locked .hp-count { opacity: 0.35; }

/* ④ 2칸 출진 경유지 */
.mn-via { color: #8a5a12; font-weight: 800; margin-left: 2px; }
.march-note .mn-via::before { content: ' · '; color: #a89060; }

/* ⑤ 방어 장수 부족 경고 */
.ci-defwarn {
  margin: 6px 0 2px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid #b4553f; background: rgba(180, 85, 63, 0.12);
  color: #7e2c1c; font-size: 11px; font-weight: 800; line-height: 1.35; word-break: keep-all;
}
.sk-defense-warn {
  margin: 6px 0; padding: 7px 9px; border-radius: 8px;
  border: 1px solid #b4553f; background: rgba(180, 85, 63, 0.12);
  color: #7e2c1c; font-size: 11.5px; font-weight: 800; line-height: 1.35; word-break: keep-all;
}

/* ② 세력일람 AI끼리 동맹·휴전 */
.dp-ai-ally { background: rgba(45, 106, 79, 0.14); color: #1b4332; border-color: #2d6a4f; }
.dp-ai-truce { background: rgba(63, 107, 138, 0.14); color: #24455c; border-color: #3f6b8a; }
.fa-pact-strip {
  margin: 6px 0 8px; padding: 7px 9px; border-radius: 8px;
  border: 1px dashed #7f9a86; background: rgba(45, 106, 79, 0.08);
  display: flex; flex-direction: column; gap: 2px;
}
.fa-pact-strip b { font-size: 11.5px; color: #1b4332; }
.fa-pact-strip span { font-size: 10.5px; color: #4a5b46; line-height: 1.4; }

/* 지도 총도독 배지 */
.map-pill.corps-pill { left: 8px; bottom: calc(44px + env(safe-area-inset-bottom)); }
.map-pill.corps-pill:not(.ready) { opacity: 0.62; }

/* 보물 세트 */
.tsx-wrap { display: flex; flex-direction: column; gap: 8px; }
.tsx-total {
  padding: 7px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; color: #3d2b18;
  background: linear-gradient(180deg, #fff6d6, #f0dca8); border: 1px solid #c8a860;
}
.tsx-total b { color: #7c4d0c; }
.tsx-sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tsx-set {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid #d8c193; background: rgba(255, 252, 243, 0.8);
}
.tsx-set.on { border-color: #b8862f; background: linear-gradient(180deg, #fff7dd, #f3e2b6); box-shadow: inset 0 0 0 1px rgba(184, 134, 47, 0.35); }
.tsx-ic { font-size: 15px; }
.tsx-main { flex: 1; min-width: 0; }
.tsx-main b { display: block; font-size: 11px; color: #33280f; }
.tsx-main span { display: block; font-size: 9.5px; color: #7b6538; }
.tsx-n { font-style: normal; font-size: 10px; font-weight: 900; color: #8a7448; white-space: nowrap; }
.tsx-set.on .tsx-n { color: #7c4d0c; }
.tsx-strip {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 4px 0 8px; padding: 7px 9px; border-radius: 9px; text-align: left;
  border: 1px solid #c8a860; background: linear-gradient(180deg, #fff8e4, #f0dfb6);
}
.tsx-strip b { font-size: 11.5px; color: #5a3c0d; }
.tsx-strip em { flex-basis: 100%; font-style: normal; font-size: 10px; color: #7b6538; }
.tsx-minis { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tsx-mini {
  font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 999px;
  border: 1px solid #cbb185; background: #fffdf6; color: #8a7448;
}
.tsx-mini.on { border-color: #2d6a4f; background: rgba(45, 106, 79, 0.12); color: #1b4332; }
.tsx-groups { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tsx-group { border: 1px solid #dcc9a0; border-radius: 8px; padding: 7px 8px; background: rgba(255, 252, 243, 0.6); }
.tsx-group-head { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.tsx-group-head b { font-size: 11.5px; color: #33280f; }
.tsx-group-head em { font-style: normal; font-size: 10px; color: #7b6538; }
.tsx-items { display: flex; flex-wrap: wrap; gap: 4px; }
.tsx-item {
  font-size: 9.5px; padding: 2px 6px; border-radius: 6px; color: #7b6a48;
  border: 1px solid #e0d2b2; background: rgba(250, 245, 233, 0.8);
}
.tsx-item i { font-style: normal; font-size: 8px; margin-left: 3px; opacity: 0.75; }
.tsx-item.got { color: #1b4332; border-color: #2d6a4f; background: rgba(45, 106, 79, 0.1); font-weight: 700; }

/* 총도독(군단) */
.cp-sum { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; }
.cp-sum span { font-size: 11px; color: #5a4a28; background: #f7efdc; border: 1px solid #ddcba4; border-radius: 7px; padding: 3px 8px; }
.cp-sum b { color: #2e2510; }
.cp-sum em { font-style: normal; color: #8a7448; font-size: 10px; }
.cp-list { display: flex; flex-direction: column; gap: 7px; margin: 8px 0; }
.cp-card { border: 1px solid #d8c193; border-left: 4px solid #b8862f; border-radius: 9px; padding: 8px 10px; background: linear-gradient(180deg, #fffdf6, #f5ead0); }
.cp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cp-card-head b { font-size: 13px; color: #2e2510; }
.cp-card-head em { font-style: normal; font-size: 10px; font-weight: 800; color: #7c4d0c; background: #f3e2b6; border-radius: 999px; padding: 1px 7px; }
.cp-card-meta { font-size: 10.5px; color: #6b5830; margin: 3px 0 5px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #3d2b18; border: 1px solid #cbb185; background: #fff8e6; border-radius: 999px; padding: 2px 8px; }
.cp-chip i { font-style: normal; font-size: 9px; color: #8a7448; }
.cp-chip.front { border-color: #b4553f; background: rgba(180, 85, 63, 0.12); color: #7e2c1c; }
.cp-card-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.cp-card-foot .btn { padding: 6px 10px; font-size: 11px; }
.cp-empty { font-size: 11px; color: #7b6538; margin: 6px 0; }
.cp-form { border-top: 1px dashed #c8b48a; padding-top: 8px; margin-top: 6px; }
.cp-form-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; }
.cp-form-head b { font-size: 12.5px; color: #2e2510; }
.cp-form-head em { font-style: normal; font-size: 10px; color: #8a7448; }
.cp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cp-row label, .cp-gov { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 800; color: #5a4a28; }
.cp-gov { margin-top: 6px; }
.cp-row input, .cp-row select, .cp-gov select { width: 100%; padding: 7px 8px; font-size: 11.5px; border-radius: 7px; border: 1px solid #c3a568; background: #fffdf6; color: #2e2510; }
.cp-cities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 7px; max-height: 168px; overflow-y: auto; padding: 5px; border: 1px solid #ddcba4; border-radius: 8px; background: rgba(255, 253, 246, 0.75); }
.cp-city { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #4a3a1a; border: 1px solid transparent; border-radius: 7px; padding: 3px 5px; }
.cp-city.on { border-color: #b8862f; background: #fdf3dc; font-weight: 800; }
.cp-city i { font-style: normal; font-size: 9px; color: #8a7448; margin-left: 3px; }
.cp-form-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.cp-form-foot .btn { padding: 8px 14px; font-size: 12px; }
.cp-warn { font-size: 10.5px; color: #7e2c1c; margin-top: 6px; }
/* v5.75 — 행군 개월 수가 좁은 줄에서 쪼개지지 않게 */
.march-note > b { white-space: nowrap; }
/* v5.75 — 군단 성 칩의 직할 회수 버튼 */
.cp-chip-x {
  margin-left: 2px; padding: 0 4px; height: 15px; border-radius: 6px;
  border: 1px solid #b4553f; background: rgba(180, 85, 63, 0.12); color: #7e2c1c;
  font-size: 8.5px; font-weight: 900; line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   v5.78 — 관직 일괄 서임 버튼 · 세력 멸망 코믹 속보 배너
   ══════════════════════════════════════════════════════════════ */
.ap-batch {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
  margin: 0 0 8px; padding: 9px 10px; border-radius: 10px; text-align: center;
  border: 1.5px solid #6d4c14;
  background: linear-gradient(180deg, #ffe08a, #f3c33f 62%, #dfa41f);
  box-shadow: 0 2px 0 #7a5410, 0 4px 10px rgba(60, 40, 8, 0.22);
  color: #2c1a04; touch-action: manipulation;
}
.ap-batch b { font-family: var(--serif); font-size: 13.5px; letter-spacing: -0.02em; }
.ap-batch span { font-size: 9.5px; font-weight: 700; color: #6b4a12; letter-spacing: -0.03em; line-height: 1.4; }
.ap-batch:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5410; filter: brightness(0.97); }

/* 세력 멸망 속보 — 모달 본문 안의 코믹 카드 */
.fb-card { display: flex; flex-direction: column; gap: 9px; padding: 2px; }
.fb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1.5px dashed rgba(120, 90, 30, 0.35); }
.fb-breaking { display: inline-flex; align-items: center; gap: 4px; background: #b3241f; color: #fff6e2; font-size: 9.5px; font-weight: 900; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; border: 1.5px solid #5e0f0c; }
.fb-when { font-size: 9.5px; font-weight: 800; color: #8a7448; }
.fb-title { display: flex; align-items: center; gap: 8px; }
.fb-flag { min-width: 34px; height: 34px; padding: 0 7px; border-radius: 8px; border: 2px solid #2c2412; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); flex: 0 0 auto; }
.fb-name { flex: 1 1 auto; min-width: 0; font-family: var(--serif); font-size: 19px; font-weight: 900; color: #2c2412; letter-spacing: -0.03em; line-height: 1.15; }
.fb-stamp { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid #b3241f; border-radius: 9px; color: #b3241f; background: rgba(179, 36, 31, 0.07); font-family: var(--serif); font-size: 22px; font-weight: 900; transform: rotate(11deg); box-shadow: inset 0 0 0 1.5px rgba(179, 36, 31, 0.3); }
.fb-stage { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1.5px solid #2c2412; background: radial-gradient(circle at 28% 22%, #fff8e8 0%, #f6dcae 100%); }
.fb-face { position: relative; flex: 0 0 auto; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 2px solid #2c2412; background: #fdf0d2; display: grid; place-items: center; }
.fb-face-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; filter: contrast(1.06) saturate(0.88); }
.fb-face-fallback { font-family: var(--serif); font-size: 26px; font-weight: 900; color: #3a2c10; }
.fb-sweat { position: absolute; top: 2px; right: 3px; font-size: 15px; line-height: 1; animation: fbSweat 1.1s ease-in-out infinite; }
.fb-tear { position: absolute; bottom: 1px; font-size: 12px; line-height: 1; animation: fbTear 1.6s ease-in-out infinite; }
.fb-tear.l { left: 5px; }
.fb-tear.r { right: 5px; animation-delay: 0.45s; }
@keyframes fbSweat { 0%, 100% { transform: translateY(0) scale(1); opacity: 0.95; } 50% { transform: translateY(4px) scale(1.08); opacity: 0.7; } }
@keyframes fbTear { 0%, 100% { transform: translateY(0); opacity: 0.9; } 50% { transform: translateY(3px); opacity: 0.55; } }
.fb-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fb-role { align-self: flex-start; font-style: normal; font-size: 9.5px; font-weight: 800; color: #8a3a12; background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(138, 58, 18, 0.32); border-radius: 6px; padding: 1px 5px; }
.fb-meta b { font-family: var(--serif); font-size: 16px; color: #2c2412; }
.fb-meta span { font-size: 10px; font-weight: 700; color: #6b5a36; }
.fb-bubble { position: relative; padding: 10px 11px; border-radius: 12px; border: 2px solid #2c2412; background: #fffdf6; box-shadow: 0 2px 0 rgba(44, 36, 18, 0.14); }
.fb-bubble::before { content: ""; position: absolute; top: -8px; left: 30px; width: 12px; height: 12px; background: #fffdf6; border-left: 2px solid #2c2412; border-top: 2px solid #2c2412; transform: rotate(45deg); }
.fb-bubble p { margin: 0; font-size: 13px; font-weight: 800; line-height: 1.5; letter-spacing: -0.02em; color: #2c2412; word-break: keep-all; }
.fb-prison-box { padding: 8px 10px; border-radius: 9px; border: 1.5px solid #d99a8a; background: #fdf0eb; font-size: 11px; font-weight: 800; line-height: 1.45; color: #7e2c1c; letter-spacing: -0.02em; }
.fb-prison-box.quiet { border-color: #cdbf9e; background: #f6f1e4; color: #5a4a28; }
.fb-prison-box b { color: inherit; }
/* v5.78 — 제목을 카드 안에서만 쓰는 창(멸망 속보)은 빈 h3 자리를 남기지 않는다 */
.modal h3:empty { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   v5.81 (?v=100) — 대규모 밸런스 패치 화면 조각
   · A급 필살기 컷인: S급보다 한 단계 조용한 배너
   · 내정 시설 카드의 [철거] 칩과 확인 창
   · 시나리오 화면의 난이도 줄
   ═══════════════════════════════════════════════════════════════════ */
#ult-cutin[data-tier="A"] .ult-band {
  padding: 6px 10px 6px 6px; border-radius: 10px; border-width: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: scale(0.94);
}
#ult-cutin[data-tier="A"] .ult-face { width: 32px; height: 32px; border-radius: 7px; }
#ult-cutin[data-tier="A"] .ult-lines strong { font-size: 14px; text-shadow: 0 1px 0 #2a1c08; }
#ult-cutin[data-tier="A"] .ult-lines b { font-size: 11.5px; }

#fx-diff-sc { padding-top: 2px; }
#screen-scenario #fx-diff-sc { padding: 0 12px 8px; }

/* 시설 카드 [철거] 칩 — 카드(버튼) 안에서 따로 눌린다 */
.sc-demolish {
  margin-left: auto; flex: none; padding: 1px 6px; border-radius: 999px;
  font-size: 9px; font-style: normal; font-weight: 900; letter-spacing: -0.02em;
  color: #8a3a2a; background: rgba(255, 236, 220, 0.92);
  border: 1px solid rgba(168, 68, 58, 0.55); white-space: nowrap; cursor: pointer;
}
.sc-demolish:active { background: #f3cdbd; }
.slot-demolish { color: #8a3a2a !important; }
.demolish-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px;
  background: rgba(255, 246, 228, 0.8); border: 1px solid #d7b87a; }
.demolish-card img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.demolish-card b { display: block; font-size: 14px; color: #3a2b12; }
.demolish-card b em { font-style: normal; font-size: 10.5px; color: #8a7448; margin-left: 4px; }
.demolish-card span { display: block; font-size: 11px; color: #5a4a2c; line-height: 1.35; margin-top: 2px; }
.demolish-card > div > em { display: block; font-style: normal; font-size: 10px; color: #8a7448; margin-top: 3px; }
.cdx-origin { margin: 2px 0 6px; font-size: 10.5px; color: #5a4a2c; letter-spacing: -0.02em; }
.cdx-origin b { color: #8a3a2a; }
.cdx-origin-tag { font-style: normal; font-size: 9px; padding: 1px 5px; border-radius: 999px;
  background: rgba(168, 68, 58, 0.1); border: 1px solid rgba(168, 68, 58, 0.35); color: #8a3a2a; margin-left: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   v5.83 — 관리자 모드 (?admin=1)  🛠️
   일반 주소에서는 DOM 자체가 없다. 어두운 먹빛 바탕 + 금빛 테두리로
   게임 화면 위에 얹히는 '도구 서랍'처럼 보이게 한다.
   ═══════════════════════════════════════════════════════════════════════════ */
.adm-fab {
  position: fixed; z-index: 40;   /* 모달(#modal-root z=50) 아래 — 창을 가리지 않는다 */
  top: calc(env(safe-area-inset-top, 0px) + 92px); right: 7px;
  min-width: 38px; height: 30px; padding: 0 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 900; letter-spacing: -0.03em; line-height: 1;
  color: #ffe9b8; background: linear-gradient(180deg, rgba(60, 48, 22, 0.96), rgba(32, 25, 11, 0.96));
  border: 1px solid #e3bd63; border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 235, 180, 0.25);
}
.adm-fab:active { transform: translateY(1px); }

.adm {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: stretch; justify-content: center;
  background: rgba(10, 8, 4, 0.55);
  font-family: var(--sans); color: #f0e3c4;
  animation: admIn 0.18s ease-out;
}
@keyframes admIn { from { opacity: 0; } to { opacity: 1; } }
.adm-box {
  width: 100%; max-width: 520px; height: 100%;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(227, 189, 99, 0.10), transparent 55%),
    linear-gradient(180deg, #241d10 0%, #1a150b 55%, #120e07 100%);
  border-left: 1px solid #6b5a2c; border-right: 1px solid #6b5a2c;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.6);
}
.adm-h {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 9px) 10px 9px;
  border-bottom: 1px solid #5a4a22;
  background: linear-gradient(180deg, #322816, #241d10);
}
.adm-h-l { display: flex; flex-direction: column; min-width: 0; }
.adm-h-l b { font-family: var(--serif); font-size: 14.5px; color: #ffe6ac; letter-spacing: -0.02em; }
.adm-h-l small { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: #a89258; }
.adm-h-r { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.adm-mini {
  border: 1px solid #e3bd63; border-radius: 7px; padding: 6px 8px;
  font-size: 10.5px; font-weight: 900; color: #2c2310;
  background: linear-gradient(180deg, #f0d79b, #d7ae58);
}
.adm-x {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid #6b5a2c; background: #241d10; color: #e8d9b4;
  font-size: 15px; font-weight: 900; line-height: 1;
}
.adm-tabs {
  flex: 0 0 auto; display: flex; gap: 3px; padding: 5px 6px;
  border-bottom: 1px solid #4a3c1c; background: #1e1810;
}
.adm-tabs button {
  flex: 1 1 auto; padding: 7px 2px; border-radius: 8px;
  border: 1px solid transparent; background: none;
  font-size: 10.5px; font-weight: 900; letter-spacing: -0.04em; color: #b6a176;
  white-space: nowrap;
}
.adm-tabs button.on {
  color: #2c2310; border-color: #e3bd63;
  background: linear-gradient(180deg, #f0d79b, #d7ae58);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.adm-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 9px 9px 16px; display: flex; flex-direction: column; gap: 8px;
}
.adm-foot {
  flex: 0 0 auto; padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 7px);
  border-top: 1px solid #4a3c1c; background: #1a150c;
  font-size: 10px; font-weight: 800; color: #9c8757; text-align: center;
}
.adm-card {
  padding: 9px; border-radius: 10px;
  border: 1px solid #4f4020; background: rgba(52, 42, 21, 0.55);
}
.adm-lead { margin: 0 0 8px; font-size: 11px; line-height: 1.5; color: #d9c79c; }
.adm-lead b { color: #ffe6ac; }
.adm-sec { margin: 0 0 6px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; color: #c9ad6a; }
.adm-hint { margin: 6px 0 0; font-size: 10px; line-height: 1.45; color: #a9925f; }
.adm-hint.center { text-align: center; }
.adm-dim { font-size: 10.5px; color: #8d7a4f; }
.adm-empty { padding: 22px 6px; text-align: center; font-size: 11.5px; color: #b6a176; }

.adm-big {
  display: block; width: 100%; padding: 13px 10px; border-radius: 10px;
  border: 1px solid #e3bd63; font-size: 14px; font-weight: 900; letter-spacing: -0.02em;
  color: #2c2310; background: linear-gradient(180deg, #f0d79b, #d7ae58);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.adm-big.on { color: #ffe2c8; border-color: #e08a6a; background: linear-gradient(180deg, #7a2f24, #4d1a13); }
.adm-big.off { color: #d9c79c; border-color: #6b5a2c; background: linear-gradient(180deg, #3a2f18, #241d10); }
.adm-big.gold { margin-top: 2px; }
.adm-big:active { transform: translateY(1px); }

.adm-speeds { display: flex; gap: 4px; margin-top: 7px; }
.adm-speeds button {
  flex: 1 1 0; padding: 8px 2px; border-radius: 8px;
  border: 1px solid #6b5a2c; background: #241d10;
  font-size: 11px; font-weight: 900; color: #d8c496;
}
.adm-speeds button.on { color: #2c2310; border-color: #e3bd63; background: linear-gradient(180deg, #f0d79b, #d7ae58); }

.adm-wide {
  display: block; width: 100%; padding: 10px; border-radius: 9px;
  border: 1px solid #6b5a2c; background: linear-gradient(180deg, #3a2f18, #241d10);
  font-size: 12px; font-weight: 900; color: #f0e3c4;
}
.adm-wide.gold { margin-top: 8px; border-color: #e3bd63; color: #2c2310; background: linear-gradient(180deg, #f0d79b, #d7ae58); }
.adm-wide.danger { border-color: #8a3f32; color: #ffd7c8; background: linear-gradient(180deg, #6d2b21, #3d1610); }
.adm-wide:active { transform: translateY(1px); }

.adm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.adm-stats > div {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 8px;
  border-radius: 7px; border: 1px solid #4f4020; background: rgba(30, 24, 12, 0.7);
}
.adm-stats span { font-size: 9.5px; font-weight: 800; color: #a9925f; }
.adm-stats b { font-size: 13px; color: #ffe6ac; letter-spacing: -0.02em; }
.adm-stats b em { font-style: normal; font-size: 10px; color: #c9ad6a; }
.adm-stats b.on { color: #a8f0b8; }

.adm-log {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 132px; overflow-y: auto;
  font-size: 10.5px; line-height: 1.4; color: #c8b483;
}
.adm-log > div { padding: 3px 6px; border-radius: 5px; background: rgba(30, 24, 12, 0.6); }

.adm-filter { display: flex; flex-direction: column; gap: 5px; }
.adm-search {
  width: 100%; padding: 9px 10px; border-radius: 8px;
  border: 1px solid #6b5a2c; background: #120e07; color: #f0e3c4;
  font-family: inherit; font-size: 12.5px;
}
.adm-search::placeholder { color: #7d6b43; }
.adm-chips { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.adm-chips::-webkit-scrollbar { display: none; }
.adm-chips button {
  flex: 0 0 auto; padding: 5px 9px; border-radius: 999px;
  border: 1px solid #5a4a22; background: #241d10;
  font-size: 10.5px; font-weight: 900; color: #b6a176; white-space: nowrap;
}
.adm-chips button.on { color: #2c2310; border-color: #e3bd63; background: linear-gradient(180deg, #f0d79b, #d7ae58); }
.adm-chips.tiers button { min-width: 44px; text-align: center; }
.adm-count { margin: 2px 0 0; font-size: 10px; font-weight: 800; color: #a9925f; }

.adm-list { display: flex; flex-direction: column; gap: 5px; }
.adm-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px;
  border-radius: 9px; border: 1px solid #4f4020;
  background: rgba(44, 35, 18, 0.7); text-align: left; color: inherit;
}
.adm-row:active { background: rgba(62, 50, 24, 0.9); }
.adm-pt {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #17120a; border: 2px solid #6b5a2c;
}
.adm-pt img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.adm-pt.big { width: 54px; height: 54px; border-width: 2.5px; }
.adm-rowmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adm-rowmain b { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: #f4e8cc; letter-spacing: -0.02em; }
.adm-rowmain small { font-size: 10px; color: #a9925f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-arrow { flex: 0 0 auto; font-size: 15px; color: #8d7a4f; }
.adm-tier {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 15px; padding: 0 3px; border-radius: 4px;
  font-size: 9.5px; font-weight: 900; font-style: normal; color: #fff;
}
.adm-tier.tier-S { background: #a8443a; }
.adm-tier.tier-A { background: #7a5aa8; }
.adm-tier.tier-B { background: #3f6fb5; }
.adm-tier.tier-C { background: #3f7a5a; }
.adm-badge {
  flex: 0 0 auto; padding: 2px 6px; border-radius: 999px;
  border: 1px solid #47673c; background: #2c3f24; color: #bfe0a8;
  font-size: 9px; font-weight: 900;
}
.adm-gem {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; border: 1px solid #4f4020; background: #17120a;
}
.adm-gem.big { width: 54px; height: 54px; font-size: 24px; }
.adm-gem.on { border-color: #e3bd63; background: rgba(227, 189, 99, 0.14); }
.adm-grade { font-size: 9.5px; font-weight: 900; font-style: normal; }
.adm-grade.g-전설 { color: #ff9a8a; }
.adm-grade.g-영웅 { color: #c9a8ff; }
.adm-grade.g-희귀 { color: #8fd8b0; }
.adm-grade.g-일반 { color: #b9a985; }

.adm-back {
  align-self: flex-start; padding: 6px 10px; border-radius: 8px;
  border: 1px solid #6b5a2c; background: #241d10;
  font-size: 11px; font-weight: 900; color: #d9c79c;
}
.adm-dhead { display: flex; align-items: center; gap: 9px; padding: 2px 1px; }
.adm-dhead > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-dhead b { font-family: var(--serif); font-size: 17px; color: #ffe6ac; letter-spacing: -0.02em; }
.adm-dhead small { font-size: 10.5px; color: #b6a176; }
.adm-dhead .adm-tier { align-self: flex-start; }
.adm-dhead .adm-hint { margin: 0; font-size: 10px; color: #c9ad6a; }

.adm-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.adm-nums.three { grid-template-columns: 1fr 1fr 1fr; }
.adm-num { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-num.wide { grid-column: 1 / -1; }
.adm-num > span, .adm-field > span { font-size: 9.5px; font-weight: 900; letter-spacing: 0.03em; color: #a9925f; }
.adm-num input, .adm-num select, .adm-field textarea {
  width: 100%; padding: 7px 8px; border-radius: 7px;
  border: 1px solid #5a4a22; background: #120e07; color: #ffe6ac;
  font-family: inherit; font-size: 13px; font-weight: 800;
  -webkit-appearance: none; appearance: none;
}
.adm-num select {
  background-image: linear-gradient(45deg, transparent 50%, #c9ad6a 50%), linear-gradient(135deg, #c9ad6a 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 24px;
}
.adm-field { display: flex; flex-direction: column; gap: 3px; }
.adm-field textarea { resize: vertical; line-height: 1.4; font-weight: 600; font-size: 12px; }
.adm-skill {
  margin-top: 7px; padding: 7px; border-radius: 8px;
  border: 1px dashed #5a4a22; background: rgba(30, 24, 12, 0.55);
  display: flex; flex-direction: column; gap: 5px;
}
.adm-skill > b { font-size: 11.5px; color: #f4e8cc; letter-spacing: -0.02em; }
.adm-skill > b em { font-style: normal; font-size: 9.5px; color: #a9925f; }
.adm-skill .adm-hint { margin: 0; font-size: 9.5px; }

.adm-sheet {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(8, 6, 2, 0.72);
}
.adm-sheet-in {
  width: 100%; max-width: 460px; padding: 12px; border-radius: 12px;
  border: 1px solid #e3bd63; background: #241d10;
  display: flex; flex-direction: column; gap: 8px;
}
.adm-sheet-in b { font-size: 13px; color: #ffe6ac; }
.adm-sheet-in textarea {
  width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #5a4a22;
  background: #120e07; color: #e8d9b4; font-family: ui-monospace, monospace; font-size: 10.5px; line-height: 1.45;
}

/* v5.83 — hidden 속성이 display:flex 에 먹히지 않게 (패널·버튼이 처음부터 떠 있던 문제) */
.adm[hidden], .adm-fab[hidden] { display: none !important; }
.adm-mini.ghost { border-color: #8a7460; color: #e4d3b0; background: linear-gradient(180deg, #4a3b25, #2c2214); }
.adm-sheet-btns { display: flex; gap: 6px; }
.adm-sheet-btns .adm-wide { margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   v5.84 — 포로·승전 MVP 코믹 한마디 말풍선 (js/patch_v584.js V584_EXTRA_LINES)
   · 결과 창(전투 결산)과 포로 처리 창 안에서만 쓰는 조용한 말풍선.
     전투 중 일반 공격 화면에는 아무것도 붙지 않는다.
   ═══════════════════════════════════════════════════════════════════════════ */
.v584-bub {
  position: relative; margin: 0 0 10px; padding: 6px 10px 7px; border-radius: 10px;
  background: linear-gradient(180deg, #fffdf5, #f6ead0);
  border: 1px solid #dcbf85; box-shadow: 0 2px 7px rgba(90, 70, 40, 0.14);
  animation: v584BubIn 0.26s ease-out both;
}
.v584-bub::after {
  content: ''; position: absolute; left: 20px; bottom: -5px; width: 9px; height: 9px;
  background: #f6ead0; border-right: 1px solid #dcbf85; border-bottom: 1px solid #dcbf85;
  transform: rotate(45deg);
}
.v584-bub .vb-tag { display: block; font-size: 9.5px; font-weight: 900; color: #8a5a1c; letter-spacing: -0.01em; }
.v584-bub p {
  margin: 2px 0 0; font-family: var(--serif); font-size: 12px; line-height: 1.42; color: #33260f;
  word-break: keep-all; overflow-wrap: anywhere;
}
/* 전투 결산 카드 안에 들어갈 때 — 카드 테두리와 겹치지 않게 조용히 */
.v584-bub.mvp {
  margin: 5px 6px 6px; background: #fffaea; box-shadow: none; animation: none;
  border-radius: 9px; padding: 5px 8px 6px;
}
.v584-bub.mvp::after { display: none; }
.v584-bub.mvp p { font-size: 11.5px; color: #5a3f12; }
@keyframes v584BubIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .v584-bub { animation: none; } }

/* ══════════════════════════════════════════════════════════════════════════
   v5.87a — 왕조 목판 & 비단 UI (AI Studio 시안 2번 → 실제 화면에 맞춰 보정)
   · 위쪽 성 헤더·아래 명령줄 = 주홍 목판 + 금박, 본문 카드 = 비단 + 금갈색 테두리
   · 실제 클래스에 맞춰 고침: 탭은 `.ct-tab`(시안의 `.city-tab` 아님), 창 머리말은
     `.modal h3`(`.modal-head` 없음), 명령줄 글자는 `.city-groups .cmd b`가 더 세므로
     그 선택자로 대비를 다시 잡았다. `.city-res .res`·`.hi-bars span`도 대비 보정.
   ══════════════════════════════════════════════════════════════════════════ */

/* 1. 상단 거점 헤더 (주홍 목판 + 금박) */
.city-top {
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border-bottom: 2.5px solid #d4a64a;
  color: #fff3cc;
  box-shadow: 0 3px 10px rgba(34, 10, 6, 0.35), inset 0 1px 0 rgba(255, 243, 204, 0.2);
}

.city-top .icon-btn,
.city-top .js-sound {
  background: linear-gradient(180deg, #74241c, #4b140f);
  border: 1.5px solid #d4a64a;
  border-radius: 8px;
  color: #fff3cc;
  box-shadow: 0 2px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.22);
}

.city-top .icon-btn:active,
.city-top .js-sound:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #260906;
}

.city-lord {
  border-color: #d4a64a;
  box-shadow: 0 2px 0 #260906, 0 0 0 1px rgba(255, 243, 204, 0.25);
}

.city-top .city-lord { color: #f4d68c; font-weight: 700; }

#city-name { color: #fff3cc; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
#city-name:active { color: #f4d68c; }

/* 성 이름 앞뒤 ◀ ▶ — 어두운 목판 위에서도 보이게 */
.city-top .city-step {
  background: linear-gradient(180deg, #74241c, #4b140f);
  border-color: #d4a64a; color: #f4d68c;
  box-shadow: 0 1px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.2);
}
.city-top .city-step:active { background: linear-gradient(180deg, #63201a, #3d100b); }
.city-top .city-step:disabled { opacity: 0.35; }

.city-top .faction-tag { color: #fff3cc; }
.city-top #city-hanja,
.city-top .city-date,
.city-top .city-stepno { color: #f0dcb0; background: none; border-color: transparent; }
.city-top #city-hanja {
  background: rgba(255, 243, 204, 0.1); border: 1px solid rgba(212, 166, 74, 0.55);
  border-radius: 7px; padding: 0 5px;
}

.city-res {
  background: rgba(34, 8, 5, 0.45);
  border: 1px solid rgba(212, 166, 74, 0.6);
  border-radius: 8px;
  color: #fff3cc;
  padding: 2px 6px 2px 5px;
}
/* 보정 — `.city-res .res`가 더 세서 어두운 글자가 남는다. 목판 위 밝은 금빛으로 */
.city-res .res { color: #fff3cc; }
.city-res .res b { color: #fff6dd; }
.city-res .res small { color: #f0dcb0; opacity: 0.9; }

.faction-tag {
  background: linear-gradient(180deg, #8a2c22, #5e1912);
  border: 1px solid #d4a64a;
  border-radius: 6px;
  color: #fff3cc;
  font-weight: 700;
}

.city-level {
  background: linear-gradient(180deg, #257350, #164731);
  border: 1px solid #d4a64a;
  border-radius: 6px;
  color: #fff3cc;
  font-weight: 700;
}

.rank-chip {
  background: linear-gradient(180deg, #f0cb6e, #c18d2f);
  border: 1px solid #fff3cc;
  border-radius: 999px;
  color: #3a170b;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* 2. 성 화면 탭 (`.city-tab` → 실제 `ct-tab`) */
.city-tabs {
  background: linear-gradient(180deg, #e9d7b3, #f3e5c5);
  border-bottom: 1.5px solid #9c7538;
  gap: 5px;
}

.ct-tab {
  background: linear-gradient(180deg, #fff8e8, #eedcb8);
  border: 1.5px solid #9c7538;
  border-left-width: 1.5px;
  border-radius: 9px;
  color: #5a3c1d;
  font-weight: 800;
  box-shadow: 0 2px 0 #d4be94;
}
.ct-tab:first-child, .ct-tab:last-child { border-left-width: 1.5px; border-radius: 9px; }

.ct-tab.on {
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border-color: #d4a64a;
  color: #fff3cc;
  box-shadow: 0 2px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}
.ct-tab.on em { color: #3a170b; background: linear-gradient(180deg, #f0cb6e, #d9ae55); border: 1px solid #a97c28; }
.ct-tab:not(.on) em { color: #7a5f24; background: rgba(255, 255, 255, 0.6); }

/* 3. 본문 · 내정 · 성 요약 (비단 배경 + 입체 금갈색 테두리) */
.city-pane { color: #3b2614; }

.city-dev {
  background:
    repeating-linear-gradient(0deg, rgba(126, 94, 48, 0.03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #fff8e8, #f8eed8);
  border-top: 0;
  color: #3b2614;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dev-head { border-bottom: 1px dashed #c8aa74; padding-bottom: 3px; color: #4a2d13; }
.city-dev .dev-lv {
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border: 1px solid #d4a64a;
  border-radius: 6px;
  color: #fff3cc;
  font-weight: 800;
  box-shadow: 0 1px 0 #260906;
}
.dev-lv em { color: #f0cf8c; }
.dev-name { color: #3b2614; font-weight: 800; }
.city-dev .dev-name { color: #3b2614; }
.dev-bars { background: transparent; }
.dev-label { color: #7a6234; }
.dev-val { color: #3b2614; }
.dev-cell { color: #4a2d13; }
.city-dev .dev-bar {
  background: #e4d1ab; border: 1px solid #b58d4c; border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(90, 70, 30, 0.22);
}
.dev-bar em { background: linear-gradient(90deg, #c98a2c, #e5b856); border-radius: 999px; }

.city-info {
  background: linear-gradient(180deg, #fff8e8, #f4e6c9);
  border-top: 1px solid rgba(156, 117, 56, 0.35);
  color: #3b2614;
}
.ci-item { color: #7a6234; }
.ci-item b { color: #3b2614; }

/* 4. 장수 스트립 — 판(board)은 투명하게 두고 장수 카드만 비단결로 */
.city-general-strip { background: none; border: 0; box-shadow: none; }
.gl-head b { color: #4a2d13; }
.gl-all {
  background: linear-gradient(180deg, #fff8e8, #eedcb8);
  border: 1.5px solid #9c7538; color: #5a3c1d;
  box-shadow: 0 1px 0 #d4be94;
}

.gen-card {
  background: linear-gradient(180deg, #fff8e8, #f4e5c3);
  border: 1.5px solid #c9a76a;
  border-radius: 10px;
  box-shadow: 0 2px 0 #d4be94, inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.gen-card.duty { border-color: #b8862f; }
.gen-card.sel { border-color: #3f6fb5; box-shadow: 0 0 0 2px rgba(63, 111, 181, 0.18), 0 2px 0 #c3b596; }
.gen-card.done { opacity: 0.66; }
.gc-pt { border-color: #b8862f; }
.gc-name { color: #3b2614; }
.gc-line2 { color: #7d6739; }
.gc-flag.ready { color: #6b4a12; background: #fbeecd; border-color: #dcc79b; }

/* 장수 Lv 뱃지 — 초상화 위(left/bottom)에서 이름 옆으로 (v5.87a 사용자 요청) */
.gc-lv {
  position: static; display: inline-block; flex: 0 0 auto;
  padding: 0 5px; border-radius: 6px;
  font-size: 8px; font-weight: 900; letter-spacing: -0.01em;
  color: #fff3cc; line-height: 13px;
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border: 1px solid #d4a64a;
  box-shadow: 0 1px 0 rgba(38, 9, 6, 0.4);
}

/* 장수 상태판 — 비단 판 위 조용한 띠 */
.city-ap { background: linear-gradient(180deg, #fbf3e0, #f3e4c5); border-top: 1px solid rgba(156, 117, 56, 0.35); }
.ap-title { color: #4a2d13; }
.ap-actor { color: #6b5427; }
.ap-delegate {
  background: linear-gradient(180deg, #fff8e8, #eedcb8);
  border: 1px solid #9c7538; color: #5a3c1d;
}

/* 5. 하단 6버튼 액션 바 (주홍 목판) */
.city-commands {
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border-top: 2.5px solid #d4a64a;
  color: #fff3cc;
  padding-top: 5px;
  box-shadow: 0 -3px 12px rgba(34, 10, 6, 0.35), inset 0 1px 0 rgba(255, 243, 204, 0.2);
}

.city-commands .cmd {
  margin: 0 1px;
  background: linear-gradient(180deg, #74241c, #49130e);
  border: 1.5px solid #d4a64a;
  border-radius: 10px;
  color: #fff3cc;
  font-weight: 700;
  box-shadow: 0 2px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.22);
}

.city-commands .cmd:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #260906;
}

.city-commands .cmd:disabled,
.city-commands .cmd.disabled {
  opacity: 0.55;
  filter: saturate(0.6);
}

/* 보정 — `.city-groups .cmd b/small/ic`가 더 세서 어두운 글자가 남는다 */
.city-commands .cmd b, .city-groups .cmd b { color: #ffe9c6; }
.city-commands .cmd small, .city-groups .cmd small { color: #e0bd84; }
.city-commands .cmd .cmd-ic, .city-groups .cmd-ic {
  background: none; border: 0; box-shadow: none;
  color: #ffd98a; font-size: 16px;
}
.city-commands .cmd.sortie b { color: #ffd0a0; }

#btn-next-month {
  background: linear-gradient(180deg, #257350, #164731);
  border: 2px solid #d4a64a;
  border-radius: 10px;
  color: #fff3cc;
  font-weight: 800;
  box-shadow: 0 2px 0 #0c2b1d, inset 0 1px 0 rgba(255, 243, 204, 0.28);
}
#btn-next-month b, .city-groups .cmd.next b, .city-commands #btn-next-month b { color: #f2ffe9; }
#btn-next-month small { color: #bfe6cc; }
#btn-next-month .cmd-ic, .city-groups .cmd.next .cmd-ic {
  background: none; border: 0; color: #eafff1; box-shadow: none;
}
#btn-next-month:active {
  background: linear-gradient(180deg, #1f6143, #123b28);
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0c2b1d;
}

/* 다음 달 — 성 화면 버튼은 id가 `btn-city-next`라 위 규칙이 닿지 않는다.
   `.city-groups .cmd.next`(0,3,0)가 남색 계열로 덮어써서 옥색이 묻히므로 같이 잡아 준다. */
.city-commands .cmd.next,
.city-groups .cmd.next,
#btn-city-next {
  background: linear-gradient(180deg, #257350, #164731);
  border: 2px solid #d4a64a;
  box-shadow: 0 2px 0 #0c2b1d, inset 0 1px 0 rgba(255, 243, 204, 0.28);
}
.city-commands .cmd.next:active,
.city-groups .cmd.next:active,
#btn-city-next:active {
  background: linear-gradient(180deg, #1f6143, #123b28);
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0c2b1d;
}
.city-commands .cmd.next b, .city-groups .cmd.next b, #btn-city-next b { color: #f2ffe9; }
.city-commands .cmd.next small, .city-groups .cmd.next small, #btn-city-next small { color: #bfe6cc; }
.city-commands .cmd.next .cmd-ic, .city-groups .cmd.next .cmd-ic, #btn-city-next .cmd-ic {
  background: none; border: 0; box-shadow: none; color: #eafff1;
}

/* 6. 모달 & 장수 상세 (비단 + 금테, 머리말은 작은 목판 명패) */
#modal-root .modal {
  background: linear-gradient(180deg, #fff8e8, #f8eed8);
  border: 2.5px solid #d4a64a;
  border-radius: 14px;
  color: #3b2614;
  box-shadow: 0 12px 28px rgba(26, 8, 4, 0.55), 0 0 0 1px #5c1a14;
}

#modal-root .modal-kicker { color: #8a5a24; }

/* 이름 명패 — 이름 + Lv 뱃지가 나란히 */
#modal-root .modal h3 {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 8px; padding: 3px 10px 4px;
  border-radius: 8px;
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border: 1.5px solid #d4a64a;
  color: #fff3cc; font-size: 17px;
  box-shadow: 0 2px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#modal-root .modal h3 .hanja { color: #f0dcb0; }

/* 장수 상세 — 이름 옆 Lv 뱃지 */
.hi-lv {
  display: inline-block; font-style: normal; font-family: var(--sans);
  padding: 0 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 900; letter-spacing: -0.01em;
  color: #3a170b; background: linear-gradient(180deg, #f0cb6e, #c18d2f);
  border: 1px solid #fff3cc;
  text-shadow: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
#modal-root .modal h3 .fh-tier {
  font-style: normal; font-size: 10px; font-weight: 900; line-height: 15px;
  margin-left: 0; padding: 0 6px; border-radius: 6px; color: #fff6e0; text-shadow: none;
}

/* 창 안 버튼 — 바탕의 목록 버튼은 건드리지 않고 아래 [확인] 줄만 */
#modal-root .modal .modal-actions .btn {
  background: linear-gradient(180deg, #6d2119, #47120d);
  border: 1.5px solid #d4a64a;
  border-radius: 8px;
  color: #fff3cc;
  font-weight: 700;
  box-shadow: 0 2px 0 #260906, inset 0 1px 0 rgba(255, 243, 204, 0.2);
}
#modal-root .modal .modal-actions .btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #260906;
}
#modal-root .modal .modal-actions .btn.btn-primary {
  background: linear-gradient(180deg, #2d7d58, #174b32);
  border-color: #d4a64a;
  color: #f4ffe9;
  box-shadow: 0 2px 0 #0c2b1d, inset 0 1px 0 rgba(255, 243, 204, 0.26);
}
#modal-root .modal .modal-actions .btn:disabled { opacity: 0.5; filter: saturate(0.7); }
#modal-root .modal .modal-actions { border-top-color: rgba(156, 117, 56, 0.4); }

.hi-portrait {
  background: linear-gradient(180deg, #5c1a14, #3e100c);
  border: 2px solid #d4a64a;
  border-radius: 12px;
  box-shadow: 0 2px 0 #d4be94, inset 0 0 0 1px rgba(255, 243, 204, 0.2);
  overflow: hidden;
}

.hi-body { background: transparent; color: #3b2614; }
.hi-cls { color: #7a6234; }
.hi-desc { color: #55422a; }

.hi-attrs div {
  background: linear-gradient(180deg, #fff8e8, #f3e4c2);
  border: 1.5px solid #d4a64a;
  border-radius: 10px;
  color: #3b2614;
  box-shadow: 0 2px 0 #d4be94;
}
.hi-attrs span { color: #8a6a38; }
.hi-attrs b { color: #3b2614; }

.hi-passive,
.hi-ultimate {
  background: linear-gradient(180deg, #fff8e8, #f8eed8);
  border: 1.5px solid #d4a64a;
  border-left: 4px solid #8a2c22;
  border-radius: 10px;
  color: #3b2614;
  box-shadow: 0 2px 0 #d4be94;
}
.hi-ultimate { border-left-color: #257350; }

/* 보정 — 알약 글자가 어두워 금빛 위에서 묻힌다 */
.hi-bars { color: #4a2d13; }
.hi-bars span {
  background: linear-gradient(90deg, #b87e28, #e5b856);
  border: 1px solid #8a5f1d;
  border-radius: 999px;
  color: #3a2607;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.hi-exp { background: #e4d1ab; border: 1px solid #b58d4c; }
.hi-exp i { background: linear-gradient(90deg, #c98a2c, #e5b856); }
.hi-next { color: #7a6234; }
.hi-merit { color: #6b5427; }

/* ══════════════════════════════════════════════════════════════
   v5.87b — 성 증축 · 친화도 외교 · 지휘 상한 · 오프닝 데스매치
   (모달 안쪽은 v5.87a의 비단·금테 위에 얹는다)
   ══════════════════════════════════════════════════════════════ */
.dm-open {
  margin: 6px 0 4px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fff3cc, #f0dcae);
  border: 1.5px solid #b0521f;
  border-left: 5px solid #8a2c22;
  border-radius: 10px;
  color: #4a1a10;
  font-size: 13px;
  line-height: 1.5;
}
.dm-open b { color: #8a2c22; }

/* 성 요약(내정 탭) 안의 증축 줄 */
.ci-up {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 8px; padding: 7px 9px;
  background: rgba(156, 117, 56, 0.12);
  border: 1px solid #c8aa74; border-radius: 9px;
  font-size: 11px; color: #4a3018;
}
.ci-up.ready { background: rgba(45, 125, 88, 0.14); border-color: #2d7d58; }
.ci-up-lb { font-weight: 800; color: #7a4a12; }
.ci-up b { font-size: 11.5px; color: #3b2614; }
.ci-up em { font-style: normal; color: #7a6234; font-size: 10px; }
.ci-up-btn {
  margin-left: auto; padding: 4px 9px;
  border: 1px solid #8a5f1d; border-radius: 8px;
  background: linear-gradient(180deg, #e5b856, #c98a2c);
  color: #3a2607; font-weight: 800; font-size: 10.5px;
  box-shadow: 0 1.5px 0 #8a5f1d;
}
.ci-up-btn.ghost { background: linear-gradient(180deg, #fff8e8, #f0e2c4); color: #6b4a1c; }

/* 성 증축 모달 */
.cup { padding: 2px 2px 4px; color: #3b2614; }
.cup-head { margin: 0 0 8px; font-size: 13px; }
.cup-head .cup-to { color: #1e6b48; }
.cup-rows > div {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; margin-bottom: 5px;
  background: rgba(156, 117, 56, 0.1);
  border: 1px solid #c8aa74; border-radius: 8px; font-size: 11.5px;
}
.cup-rows span { color: #5c421f; font-weight: 700; }
.cup-rows span em { font-style: normal; font-weight: 400; color: #8a7448; font-size: 10px; }
.cup-v { font-size: 11.5px; }
.cup-v.on { color: #1e6b48; }
.cup-v.off { color: #a1251b; }
.cup-gain {
  display: grid; gap: 2px; margin: 8px 0;
  padding: 8px 9px; font-size: 11px; line-height: 1.55;
  background: linear-gradient(180deg, #fff8e8, #f4e6c8);
  border: 1px solid #d4a64a; border-radius: 9px;
}
.cup-gain b { color: #7a2e1f; }
.cup-note { margin: 6px 0 0; font-size: 10.5px; color: #6b5427; line-height: 1.5; }
.cup-note.warn { color: #a1251b; }

/* 친화도 외교 */
.aff-list { display: grid; gap: 8px; }
.aff-card {
  padding: 8px 9px;
  background: linear-gradient(180deg, #fff8e8, #f6ecd6);
  border: 1px solid #d4a64a; border-radius: 10px;
  box-shadow: 0 2px 0 #d4be94;
}
.aff-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #3b2614; }
.aff-flag {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px;
  color: #fff; font-size: 10px; font-weight: 800;
  border: 1px solid rgba(255, 243, 204, 0.6);
}
.aff-head em { font-style: normal; font-size: 10px; color: #7a6234; }
.aff-badge {
  margin-left: auto; padding: 2px 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800;
}
.aff-badge.war { background: #f3d9d3; color: #8a2c22; border: 1px solid #c98d80; }
.aff-badge.truce { background: #e8e2f5; color: #4b2f6b; border: 1px solid #a897cd; }
.aff-badge.ally { background: #dcf0e4; color: #1e6b48; border: 1px solid #7fb99a; }
.aff-meter {
  position: relative; height: 20px; margin: 6px 0;
  background: #e4d1ab; border: 1px solid #b58d4c; border-radius: 999px;
  overflow: hidden;
}
.aff-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #c98a2c, #e5b856);
}
.aff-tick {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #8a2c22; opacity: 0.5; text-decoration: none;
}
.aff-tick.ally { background: #1e6b48; opacity: 0.7; }
.aff-num {
  position: relative; display: block; padding-left: 9px;
  font-size: 10px; line-height: 18px; color: #3b2614; font-weight: 700;
}
.aff-num b { color: #7a2e1f; }
.aff-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.aff-btns button {
  padding: 6px 4px; font-size: 10px; font-weight: 700;
  background: linear-gradient(180deg, #fff8e8, #efe0c0);
  border: 1px solid #b58d4c; border-radius: 8px; color: #3b2614;
}
.aff-btns button em { font-style: normal; color: #1e6b48; font-weight: 800; }
.aff-btns button.wide { grid-column: span 1; }
.aff-btns button.off { opacity: 0.55; }
.aff-why { margin: 5px 0 0; font-size: 9.5px; color: #8a5f2a; line-height: 1.45; }

.aff-mini {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px; padding: 7px 9px;
  background: rgba(156, 117, 56, 0.12);
  border: 1px solid #c8aa74; border-radius: 9px;
  font-size: 11px; color: #3b2614;
}
.aff-mini b { color: #8a2c22; }
.aff-mini-bar {
  flex: 1 1 90px; position: relative; height: 6px;
  background: #e4d1ab; border-radius: 999px; overflow: hidden;
}
.aff-mini-bar em { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #c98a2c, #e5b856); }
.aff-mini-need { font-size: 9.5px; color: #7a6234; }

/* 지휘 병력 상한 안내 */
.ocg { color: #3b2614; }
.ocg-now {
  margin-bottom: 8px; padding: 8px 9px;
  background: linear-gradient(180deg, #fff8e8, #f4e6c8);
  border: 1px solid #d4a64a; border-left: 4px solid #8a2c22; border-radius: 9px;
}
.ocg-now > b { font-size: 13px; }
.ocg-now > em { font-style: normal; font-size: 10px; color: #7a6234; }
.ocg-rows { display: grid; gap: 2px; margin-top: 5px; }
.ocg-row { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; color: #4a3018; padding: 2px 0; border-bottom: 1px dashed rgba(156, 117, 56, 0.35); }
.ocg-row b { color: #3b2614; }
.ocg-cap { color: #1e6b48; }
.ocg-sum {
  margin: 0 0 8px; padding: 7px 9px; font-size: 10.5px; line-height: 1.6;
  background: rgba(156, 117, 56, 0.1); border: 1px solid #c8aa74; border-radius: 8px;
}
.ocg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ocg-h { margin: 0 0 4px; font-size: 10.5px; font-weight: 800; color: #7a2e1f; }
.ocg-note { margin: 8px 0 0; font-size: 9.5px; color: #6b5427; line-height: 1.5; }

.hi-cap-note { margin: 3px 0 6px; font-size: 9.5px; color: #6b5427; line-height: 1.45; }
.ap-pick-cap { color: #1e6b48; }

/* ══════════════════════════════════════════════════════════════════════
   v5.88 — 수송·장수 이동(1칸 = 1개월) · 군단 위임 잠금
   ══════════════════════════════════════════════════════════════════════ */
.city-transit {
  margin: 4px 10px 8px; padding: 7px 9px; border: 1px solid #c8a86a; border-radius: 9px;
  background: linear-gradient(180deg, #fdf6e4, #f3e7c8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.city-transit .ct-head { margin: 0 0 4px; font-size: 11px; font-weight: 800; color: #6b4a1f; display: flex; gap: 6px; align-items: baseline; }
.city-transit .ct-head em { font-style: normal; font-weight: 600; font-size: 10px; color: #8a6a3a; }
.city-transit .ct-row { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: #4a3a20; padding: 2px 0; border-top: 1px dashed rgba(160,130,80,.35); }
.city-transit .ct-row:first-of-type { border-top: 0; }
.city-transit .ct-row b { flex: 0 0 auto; font-size: 11px; color: #3d2c14; }
.city-transit .ct-row span { flex: 1 1 auto; color: #5c4726; font-size: 10.5px; }
.city-transit .ct-row em { flex: 0 0 auto; font-style: normal; font-weight: 800; font-size: 10px; color: #8a2c22; }
.city-transit .ct-more { margin: 3px 0 0; font-size: 10px; color: #8a6a3a; }
.tr-eta { color: #6b4a1f; }

/* 군단 위임 잠금 — 성 화면 위 안내줄과 잠금 표시 */
.corps-lock-bar {
  display: flex; align-items: center; gap: 8px; margin: 6px 10px 4px; padding: 8px 10px;
  border: 1px solid #8a6a2a; border-radius: 10px; background: linear-gradient(180deg, #3f2f16, #2c2110);
  color: #f3e7c8; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.corps-lock-bar .clb-ic { font-size: 18px; color: #e8c268; }
.corps-lock-bar .clb-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.corps-lock-bar .clb-main b { font-size: 11.5px; color: #ffe6a8; }
.corps-lock-bar .clb-main span { font-size: 10px; line-height: 1.35; color: #d8c7a2; }
.corps-lock-bar .clb-btn {
  flex: 0 0 auto; padding: 7px 10px; border-radius: 8px; border: 1px solid #d8b464;
  background: linear-gradient(180deg, #e8c268, #c9992f); color: #2c2110; font-weight: 900; font-size: 11px;
}
#screen-city.corps-locked .city-commands .cmd[data-grp] { opacity: .45; filter: grayscale(.5); }
#screen-city.corps-locked .city-pane .slot-card,
#screen-city.corps-locked .city-pane .dev-card,
#screen-city.corps-locked .city-pane .gen-card { cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   v5.89 — 보물 능력치 합산 표기 · 총도독 전쟁 관전 배너
   ══════════════════════════════════════════════════════════════ */
/* 성 장수 카드: 통72 +4 */
.gc-nums em.gc-up { font-style: normal; font-size: 7px; font-weight: 900; color: #a8443a; margin-left: 1px; vertical-align: 1px; letter-spacing: -0.04em; }
/* 시설 담당·부장 카드: 통 72(+4) */
.sd-stats em.sd-up { font-style: normal; color: #a8443a; font-weight: 800; font-size: 10px; }
/* 장수 명부: 보물 보정이 붙은 칸은 진한 색 */
.rs-num.up { color: #7a2a12; font-weight: 900; }
/* 포상 목록의 성 이름 배지 */
.rw-where { font-style: normal; font-weight: 800; color: #7a5a12; background: rgba(212, 166, 74, 0.18); border: 1px solid rgba(156, 117, 56, 0.35); border-radius: 4px; padding: 0 4px; margin-right: 3px; font-size: 10px; }
.rw-where.here { color: #257350; background: rgba(37, 115, 80, 0.14); border-color: rgba(37, 115, 80, 0.35); }
/* 총도독 전쟁 관전·자동 결산 배너 (전장 위) */
.spectate-bar { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 9; max-width: 94%; padding: 5px 10px; border-radius: 999px; background: rgba(92, 26, 20, 0.92); color: #ffeec2; font-size: 11px; font-weight: 800; letter-spacing: -0.01em; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spectate-bar b { color: #ffd76a; margin-right: 4px; }

/* v5.89 — 관전·자동결산 중에는 후퇴·자동토글·배속 버튼을 확실히 감춘다
   (hidden 속성만으로는 .act/.icon-btn의 display 규칙에 져서 화면에 남는다) */
#screen-battle.spectating #btn-retreat,
#screen-battle.spectating #btn-speed,
#screen-battle.spectating #battle-actions .act.auto { display: none !important; }
#screen-battle.spectating #battle-actions .act:not(.speed) { opacity: .45; filter: grayscale(.45); }
