@font-face { font-family: 'Galmuri11'; src: url('assets/ui/fonts/Galmuri11.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Galmuri11'; src: url('assets/ui/fonts/Galmuri11-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }

:root {
  --bg: #0b0c0a;
  --metal-hi: #5a635a;
  --metal: #353b35;
  --metal-lo: #181c18;
  --line: #5d6a5d;
  --green: #46ff5a;
  --green-soft: #9dffae;
  --text: #d6e6cf;
  --dim: #8fa38a;
  --warn: #ffb24a;
  --red: #ff5a4a;
  --hud-h: 172px;
  --card-w: 104px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { font-family: 'Galmuri11', 'Apple SD Gothic Neo', sans-serif; font-size: 12px; color: var(--text); user-select: none; -webkit-font-smoothing: none; }
button { font-family: inherit; }
#app { position: fixed; inset: 0; }
#world { position: absolute; inset: 0; display: block; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 금속 틀 */
.frame, #topbar, .card, .win {
  background: linear-gradient(180deg, #2c322c 0%, #1b1f1b 100%);
  border: 1px solid #0a0c0a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.6), 0 0 0 1px #465046;
}

/* ---------------------------------------------------------------- 상단 줄 */
#topbar {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 18px; align-items: center; padding: 5px 14px; border-radius: 3px; white-space: nowrap;
  max-width: calc(100vw - 2 * var(--card-w) - 40px); overflow: hidden;
}
.tb-loc { display: flex; align-items: center; gap: 6px; color: var(--green-soft); }
.tb-dot { width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 6px var(--green); border-radius: 50%; }
.tb-res { display: flex; gap: 12px; color: var(--dim); }
.tb-res b { color: #fff; font-weight: 400; }
.rdot { display: inline-block; width: 7px; height: 7px; border-radius: 1px; margin-right: 4px; vertical-align: 0; }
.ricon { width: 18px; height: 18px; vertical-align: -5px; margin-right: 3px; }
.tb-res .r { white-space: nowrap; }

/* ---------------------------------------------------------------- 유닛 카드 */
.cards { position: absolute; top: 6px; bottom: calc(var(--hud-h) + 6px); width: var(--card-w); display: flex; flex-direction: column; gap: 4px; }
#cards-left { left: 6px; }
#cards-right { right: 6px; }
.card { position: relative; flex: 0 1 96px; max-height: 96px; min-height: 60px; border-radius: 2px; cursor: pointer; overflow: hidden; background: linear-gradient(180deg, #16241a, #0b120c); }
.card.empty { opacity: 0.28; pointer-events: none; background: linear-gradient(180deg, #1a1d1a, #0e100e); }
.card-img { position: absolute; left: 3px; right: 3px; top: 3px; bottom: 26px; background: center / contain no-repeat; image-rendering: auto; }
.card .bar { position: absolute; left: 4px; right: 4px; height: 3px; background: #000; }
.card .bar i { display: block; height: 100%; width: 100%; background: var(--green); }
.card .bar.hp { bottom: 21px; }
.card .bar.en { bottom: 17px; height: 2px; }
.card .bar.en i { background: #4aa8ff; }
.card-name { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; line-height: 16px; text-align: center; background: rgba(0,0,0,0.72); color: #f4fff0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.card-lv { position: absolute; right: 4px; top: 3px; color: var(--green-soft); font-size: 11px; text-shadow: 1px 1px 0 #000; }
.card.sel { box-shadow: inset 0 0 0 2px var(--green), 0 0 8px rgba(70,255,90,0.45); }
.card.dead .card-img { filter: grayscale(1) brightness(0.4); }
.card.dead .card-name { color: var(--red); }
.card.dead::after { content: '파괴'; position: absolute; inset: 0 0 26px; display: grid; place-items: center; color: var(--red); font-weight: 700; text-shadow: 1px 1px 0 #000; }
.card.low .bar.hp i { animation: blink 0.6s steps(2) infinite; }
.card:hover:not(.empty) { box-shadow: inset 0 0 0 1px #9dffae; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------------------------------------------------------------- 하단 */
#bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--hud-h);
  display: flex; gap: 6px; padding: 14px 8px 8px;
  background: url('assets/ui/hud-strip.jpg') 0 0 / auto 100% repeat-x, #232823;
  border-top: 1px solid #7a867a;
  box-shadow: 0 -2px 0 #0a0c0a, 0 -8px 18px rgba(0,0,0,0.55);
}
.deco-top { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.deco-top i { width: 36px; height: 7px; background: linear-gradient(180deg, #6c786c, #2a302a); border: 1px solid #0a0c0a; border-bottom: 0; border-radius: 3px 3px 0 0; }
#bottom .frame { border-radius: 3px; position: relative; }
#bottom .frame::before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(0,0,0,0.6); pointer-events: none; border-radius: 2px; }
.frame.mm { width: calc(var(--hud-h) - 16px); flex: none; padding: 5px; }
#minimap { width: 100%; height: 100%; display: block; background: #050605; cursor: pointer; image-rendering: auto; }
.frame.chat { flex: 1; min-width: 200px; display: flex; flex-direction: column; padding: 6px; background: linear-gradient(180deg, #1c0a08, #0d0404); }
#chatlog { flex: 1; overflow-y: auto; padding: 2px 6px; line-height: 16px; font-size: 12px; scrollbar-width: thin; scrollbar-color: #4a5a4a #120606; }
#chatlog .ln { white-space: pre-wrap; word-break: keep-all; }
#chatlog .sys { color: #fff3a8; }
#chatlog .info { color: #e6e6e6; }
#chatlog .npc { color: #d8e8ff; }
#chatlog .me { color: #fff; }
#chatlog .warn { color: #ff8a6a; }
#chatlog .lvl { color: #8dff8a; }
#chatlog .help { color: #7fe0ff; }
.chat-input { height: 20px; border-top: 1px solid #3a1a14; margin-top: 3px; }
#chatin { width: 100%; height: 100%; background: transparent; border: 0; color: #fff; font: inherit; outline: none; padding: 0 6px; user-select: text; }
#chatin::placeholder { color: #6a5a52; }
.frame.icons { width: 52px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 6px 7px; justify-content: center; }
.icon-btn { position: relative; height: 25px; background: #6a8a6a; border: 0; cursor: pointer; padding: 0; display: grid; place-items: center; clip-path: polygon(0 0, 72% 0, 100% 45%, 100% 100%, 0 100%); }
.icon-btn::before { content: ''; position: absolute; inset: 1px; background: linear-gradient(180deg, #1c241c, #0a0e0a); clip-path: polygon(0 0, 72% 0, 100% 45%, 100% 100%, 0 100%); }
.icon-btn svg { position: relative; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: #8dff8a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--green); }
.icon-btn:hover::before { background: linear-gradient(180deg, #243a24, #0e1a0e); }
.frame.icons { width: 58px !important; }
.frame.dial { width: calc(var(--hud-h) - 8px); flex: none; padding: 2px; background: url('assets/ui/dial.png') center / 96% no-repeat, radial-gradient(circle, #151815 60%, #0c0e0c 70%); box-shadow: none; border: 0; }
#bottom .frame.dial::before { display: none; }
#dial-svg { width: 100%; height: 100%; display: block; }
.seg-wrap { cursor: pointer; }
.seg { fill: transparent; stroke: none; transition: fill 0.1s; }
.seg-icon { fill: none; stroke: #8dff8a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seg-wrap:hover .seg { fill: rgba(70,255,90,0.16); }
.seg-wrap.on .seg { fill: rgba(70,255,90,0.3); }
.seg-icon { filter: drop-shadow(0 0 2px rgba(80,255,100,0.7)); }
.seg-wrap.off { opacity: 0.35; }
.dial-time { fill: #ffc080; font-family: 'Galmuri11'; font-size: 13px; letter-spacing: 1px; paint-order: stroke; stroke: rgba(0,0,0,0.75); stroke-width: 2.5px; filter: drop-shadow(0 0 3px rgba(255,140,40,0.8)); pointer-events: none; }
.dial-pie { pointer-events: none; }
.dial-pie .pie-fight { animation: blink 0.5s steps(2) infinite; }

/* 틀 위쪽 작은 탭 · 채팅 줄 버튼 */
.top-tabs { position: absolute; top: -12px; right: calc(var(--hud-h) + 76px); display: flex; gap: 2px; z-index: 2; }
.top-tabs button { width: 26px; height: 16px; padding: 0; font-size: 11px; line-height: 14px; color: #8dff8a; background: linear-gradient(180deg, #3a443a, #1a201a); border: 1px solid #6a786a; border-bottom: 0; border-radius: 3px 3px 0 0; cursor: pointer; }
.top-tabs button:hover { color: #fff; background: linear-gradient(180deg, #3f6a40, #1f3a1f); }
.hero-mode .top-tabs { right: calc(var(--hud-h) + 98px); }
.chat-input { display: flex; align-items: center; gap: 2px; }
#chatin { flex: 1; }
.cbtn { height: 17px; min-width: 20px; padding: 0 3px; font-size: 10px; line-height: 15px; color: #8dff8a; background: #101810; border: 1px solid #3f6a40; cursor: pointer; }
.cbtn:hover, .cbtn.on { background: #1f4a22; color: #fff; }

/* 주변 커맨더 목록 (수도 · 원작 우측 녹색 목록창) */
.frame.people { width: calc(var(--hud-h) + 30px); flex: none; display: flex; flex-direction: column; padding: 6px; background: #050805; box-shadow: inset 0 0 0 1px #2f7a36, inset 0 0 0 2px #0a0c0a, 0 0 0 1px #465046; }
.pp-head { display: flex; gap: 4px; align-items: center; padding-bottom: 4px; border-bottom: 1px solid #1f4a22; }
.pp-tab { width: 20px; height: 16px; display: grid; place-items: center; border: 1px solid #2f7a36; color: #7dff7a; font-size: 10px; background: #0c180c; }
.pp-tab.on { background: #1f4a22; box-shadow: 0 0 6px rgba(70,255,90,0.35); }
.pp-count { margin-left: auto; color: var(--dim); font-size: 11px; }
#people-list { flex: 1; overflow-y: auto; padding-top: 3px; scrollbar-width: thin; scrollbar-color: #2f7a36 #050805; }
.pp-row { color: #e8f0e4; line-height: 17px; padding: 0 6px; border-bottom: 1px solid #0f1e10; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-row:hover { background: #143016; color: #fff; }
.pp-row.me { color: #9dffae; cursor: default; }
#chatlog .whisper { color: #ff9ad8; }

/* ---------------------------------------------------------------- 툴팁 · 배너 */
#tooltip { position: fixed; z-index: 30; max-width: 320px; padding: 6px 9px; background: rgba(8,12,8,0.92); border: 1px solid #56685a; color: var(--text); line-height: 16px; pointer-events: none; }
#tooltip b { color: var(--green-soft); font-weight: 400; }
#tooltip .tt-red { color: #ff8a7a; }
#tooltip .tt-k { color: #8fa38a; }
#banner { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; }
#banner.show { animation: banner 2.6s ease forwards; }
.b-title { font-size: 28px; color: #eaffea; text-shadow: 0 0 12px rgba(70,255,90,0.6), 2px 2px 0 #000; letter-spacing: 2px; }
.b-sub { margin-top: 6px; color: var(--green-soft); text-shadow: 1px 1px 0 #000; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 8px); } 12% { opacity: 1; transform: translate(-50%, 0); } 78% { opacity: 1; } 100% { opacity: 0; } }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.35s; z-index: 50; display: grid; place-items: center; }
#fade.on { opacity: 1; pointer-events: all; }
#loading-note { color: var(--dim); }

/* ---------------------------------------------------------------- 창 */
#panel-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.win-back { position: absolute; inset: 0 0 var(--hud-h) 0; display: grid; place-items: center; background: rgba(0,0,0,0.35); pointer-events: all; }
.win { max-width: calc(100vw - 20px); max-height: calc(100vh - var(--hud-h) - 24px); display: flex; flex-direction: column; border-radius: 3px; }
.win-title { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: linear-gradient(180deg, #3e483e, #232823); border-bottom: 1px solid #0a0c0a; font-size: 13px; }
.win-title b { color: #efffea; font-weight: 700; }
.win-sub { color: var(--dim); }
.win-dot { width: 9px; height: 9px; background: var(--green); border-radius: 50%; box-shadow: 0 0 6px var(--green); }
.win-x { margin-left: auto; width: 22px; height: 20px; background: #1a1f1a; border: 1px solid #56685a; color: #9dffae; cursor: pointer; line-height: 16px; font-size: 16px; }
.win-x:hover { background: #3a1a14; color: #fff; }
.win-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: #151915; border-bottom: 1px solid #3f4a3f; }
.tab { padding: 6px 14px; background: #1d231d; color: var(--dim); border: 1px solid #3f4a3f; border-bottom: 0; cursor: pointer; font-size: 12px; }
.tab.on { background: #2b3a2b; color: #eaffea; box-shadow: inset 0 2px 0 var(--green); }
.win-body { padding: 12px; overflow: auto; background: linear-gradient(180deg, #121612, #0c0f0c); scrollbar-width: thin; scrollbar-color: #4a5a4a #0c0f0c; }
.win-body h4 { margin: 10px 0 6px; color: var(--green-soft); font-weight: 400; font-size: 12px; }
.note { color: var(--dim); line-height: 17px; margin: 4px 0 8px; }
.warn { color: var(--warn); margin: 8px 0; line-height: 17px; }
.hint { color: #7fe0ff; margin: 8px 0; }
.notice { color: #fff3a8; background: #1c1a08; border: 1px solid #4a4520; padding: 8px 10px; margin: 10px 0; }
.empty-note { color: var(--dim); padding: 12px; }

.btn { background: linear-gradient(180deg, #2f4a30, #172617); color: #eaffea; border: 1px solid #5a8a5a; padding: 5px 12px; cursor: pointer; font-size: 12px; border-radius: 2px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }
.btn:hover:not(:disabled) { background: linear-gradient(180deg, #3f6a40, #1f3a1f); border-color: var(--green); }
.btn:disabled { opacity: 0.4; cursor: default; filter: grayscale(0.6); }
.btn.big { display: block; width: 100%; padding: 10px; font-size: 14px; margin-top: 10px; }
.btn.sm { padding: 4px 10px; white-space: nowrap; }
.btn.xs { padding: 1px 7px; font-size: 12px; }
.btn.danger { background: linear-gradient(180deg, #4a2a24, #2a1410); border-color: #8a4a3a; }
.tag { color: var(--dim); border: 1px solid #3f4a3f; padding: 3px 8px; white-space: nowrap; }
.tag.ok { color: var(--green-soft); border-color: #3f6a40; }

.pt { background: center / contain no-repeat; width: 72px; height: 72px; flex: none; }
.pt.sm { width: 44px; height: 44px; }
.pt.big { width: 120px; height: 120px; background-color: #0c140d; border: 1px solid #2c3a2c; }
.cls { display: inline-block; padding: 0 5px; font-size: 11px; border: 1px solid; }
.cls-inf { color: #9dffae; border-color: #3f6a40; }
.cls-mob { color: #ffd07a; border-color: #6a5a30; }
.cls-avi { color: #8ac8ff; border-color: #30506a; }
.cls-org { color: #ff9ad0; border-color: #6a3050; }

table.stats { border-collapse: collapse; width: 100%; margin: 6px 0; }
table.stats th { text-align: left; color: var(--dim); font-weight: 400; padding: 3px 8px 3px 0; width: 90px; vertical-align: top; }
table.stats td { color: #eef8ea; padding: 3px 0; line-height: 16px; }

/* 상점 */
.split { display: grid; grid-template-columns: 1fr 320px; gap: 12px; }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; align-content: start; }
.shop-item { position: relative; background: #121a13; border: 1px solid #2c3a2c; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.shop-item .pt { width: 84px; height: 84px; }
.shop-item:hover { border-color: #5a8a5a; }
.shop-item.on { border-color: var(--green); box-shadow: 0 0 8px rgba(70,255,90,0.3); background: #182a19; }
.shop-item.locked .pt { filter: grayscale(1) brightness(0.55); }
.si-name { color: #eaffea; }
.si-meta { color: var(--dim); font-size: 11px; }
.si-lock { position: absolute; top: 6px; right: 6px; color: var(--warn); font-size: 11px; }
.shop-detail { background: #0f140f; border: 1px solid #2c3a2c; padding: 10px; }
.sd-head { display: flex; gap: 10px; align-items: flex-start; }
.sd-head > div:last-child { flex: 1; min-width: 120px; }
.sd-name { font-size: 15px; color: #efffea; }
.sd-cls { color: var(--dim); margin: 3px 0; }
.sd-desc { color: #c9d9c3; line-height: 17px; margin: 6px 0; }

.mod { display: grid; grid-template-columns: 180px 1fr 300px; gap: 10px; min-height: 420px; }
.unit-list, .part-list { background: #0f140f; border: 1px solid #2c3a2c; overflow: auto; max-height: 560px; }
.ul-row { display: flex; gap: 6px; align-items: center; padding: 4px 6px; cursor: pointer; border-bottom: 1px solid #1a221a; }
.ul-row:hover { background: #162016; }
.ul-row.on { background: #1f3a20; box-shadow: inset 3px 0 0 var(--green); }
.ul-row.dead { opacity: 0.55; }
.ul-name { color: #eaffea; }
.ul-meta { color: var(--dim); font-size: 11px; }
.mod-mid { display: flex; flex-direction: column; gap: 4px; }
.cap { display: grid; grid-template-columns: 50px 1fr 64px; align-items: center; gap: 6px; }
.cap-l { color: var(--dim); }
.cap-bar { height: 8px; background: #050705; border: 1px solid #2c3a2c; }
.cap-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f8a3a, #46ff5a); }
.cap.over .cap-bar i { background: var(--red); }
.cap.over .cap-v { color: var(--red); }
.cap-v { text-align: right; color: #eaffea; }
.slots { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.slot { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: #121a13; border: 1px solid #243024; cursor: pointer; }
.slot:hover { border-color: #5a8a5a; }
.slot.on { border-color: var(--green); background: #1a2e1b; }
.slot.na { opacity: 0.45; cursor: default; }
.slot-n { width: 50px; color: var(--dim); flex: none; }
.slot-p { flex: 1; color: #eaffea; }
.pl-head { display: flex; justify-content: space-between; padding: 7px 8px; background: #1a221a; color: var(--green-soft); position: sticky; top: 0; z-index: 1; }
.pl-head span { color: var(--dim); }
.part { padding: 8px; border-bottom: 1px solid #1a221a; display: flex; flex-direction: column; gap: 3px; }
.part.on { background: #16261a; box-shadow: inset 3px 0 0 var(--green); }
.part.locked { opacity: 0.55; }
.p-top { display: flex; justify-content: space-between; }
.p-top b { color: #eaffea; font-weight: 400; }
.p-tech { color: #7fe0ff; }
.p-sum { color: #c9d9c3; line-height: 16px; }
.p-note { color: var(--dim); line-height: 16px; }
.p-foot { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; }
.p-cost { color: #ffd84a; }
.p-why { color: var(--warn); font-size: 11px; }
.part .btn { align-self: flex-end; }

.rows { display: flex; flex-direction: column; gap: 3px; }
.row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: #111811; border: 1px solid #222c22; cursor: default; }
label.row { cursor: pointer; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-main b { color: #eaffea; font-weight: 400; }
.row-meta { color: var(--dim); font-size: 11px; line-height: 15px; }
.hpbar { height: 4px; background: #050705; width: 180px; }
.hpbar i { display: block; height: 100%; background: var(--green); }
.row input[type='checkbox'] { accent-color: #46ff5a; width: 16px; height: 16px; }

/* 커맨더 */
.cmd { display: grid; grid-template-columns: 200px 1fr 190px; gap: 10px; }
.cmd-col { display: flex; flex-direction: column; gap: 10px; }
.cmd-box { background: #0f140f; border: 1px solid #2c3a2c; padding: 8px; }
.box-h { color: #cfe8c8; background: #1d241d; margin: -8px -8px 8px; padding: 4px 8px; letter-spacing: 1px; font-size: 11px; border-bottom: 1px solid #2c3a2c; }
.cmd-pt { width: 100%; aspect-ratio: 1; background: center / cover; border: 1px solid #2c3a2c; margin-bottom: 6px; }
.div-row { display: grid; grid-template-columns: 40px 34px 64px 1fr 40px; gap: 6px; align-items: center; margin: 5px 0; }
.div-name { color: var(--dim); }
.div-pct { text-align: right; color: #eaffea; }
.stat-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.stat-row b { width: 36px; color: #eaffea; font-weight: 400; }
.stat-v { width: 28px; text-align: center; color: #fff; }
.stat-e { color: var(--dim); flex: 1; }
.res-row { display: flex; align-items: center; gap: 4px; margin: 6px 0; color: var(--dim); }
.res-row b { margin-left: auto; color: #fff; font-weight: 400; }

.nation-flag { display: inline-block; padding: 8px 18px; color: #000; font-size: 16px; margin-bottom: 8px; }
.pmap-wrap { display: flex; gap: 14px; }
.pmap { width: 400px; height: 400px; border: 1px solid #2c3a2c; background: #080a08; }
.pmap-side p { color: #c9d9c3; line-height: 17px; }
.planet { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #4a5a4a; }
table.ex { width: 100%; border-collapse: collapse; }
table.ex th { color: var(--dim); font-weight: 400; text-align: left; padding: 6px; border-bottom: 1px solid #2c3a2c; }
table.ex td { padding: 7px 6px; border-bottom: 1px solid #1a221a; }
.ex-btns { display: flex; gap: 3px; justify-content: flex-end; }
.mon-list { display: flex; flex-direction: column; gap: 4px; }
.mon { display: flex; gap: 8px; align-items: center; background: #111811; border: 1px solid #222c22; padding: 4px 8px; }
.mon b { font-weight: 400; color: #ffcfc8; }

/* ---------------------------------------------------------------- 타이틀 · 등록 */
#screen { position: fixed; inset: 0; z-index: 40; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #050605; }
.load-bar { width: 320px; height: 8px; border: 1px solid #3f4a3f; background: #0a0c0a; }
.load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2f8a3a, #46ff5a); transition: width 0.1s; }
.load-note { color: var(--dim); }
.title { position: absolute; inset: 0; overflow: hidden; background: #050605; }
.title-art { position: absolute; inset: 0; background: url('assets/art/key.jpg') center / cover no-repeat; animation: pan 40s ease-in-out infinite alternate; }
.title-art.dim { filter: brightness(0.35) blur(2px); }
@keyframes pan { from { transform: scale(1.05) translateX(-1%); } to { transform: scale(1.12) translateX(1%); } }
.title-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 45%, rgba(0,0,0,0) 70%), linear-gradient(0deg, rgba(0,0,0,0.7), transparent 30%); }
.title-main { position: absolute; left: 7vw; top: 16vh; }
.logo { font-family: 'Galmuri11'; font-weight: 700; font-size: 64px; line-height: 0.95; letter-spacing: 4px; color: #dfe8e4; background: linear-gradient(180deg, #ffffff 0%, #b8c8d0 45%, #5a7080 52%, #d8e4ea 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 1px #5ac8ff) drop-shadow(3px 4px 0 rgba(0,0,0,0.85)); font-style: italic; }
.logo.small { font-size: 36px; text-align: center; }
.logo-sub { margin-top: 12px; color: #9dffae; font-size: 14px; letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }
.title-btns { display: flex; gap: 10px; margin-top: 34px; }
.title-app { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.title-app-note { max-width: min(420px, calc(100vw - 14vw)); margin-top: 8px; font-size: 12px; line-height: 1.5; color: #9fb4a3; }
/* 폰 가로 화면처럼 낮은 화면: 로고를 줄이고 안내 문구는 숨긴다 */
@media (max-height: 460px) {
  .title-main { top: 5vh; }
  .title-main .logo { font-size: 40px; }
  .title-btns { margin-top: 14px; }
  .title-app-note { display: none; }
}
.title-btn { font-size: 15px; padding: 12px 28px; }
.title-btn.primary { border-color: var(--green); box-shadow: 0 0 12px rgba(70,255,90,0.25), inset 0 1px 0 rgba(255,255,255,0.15); }
.title-save { margin-top: 12px; color: var(--dim); }
.title-foot { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #6f7f6a; font-size: 11px; }
.create { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 720px; max-height: 92vh; }
.inp { width: 100%; padding: 8px 10px; background: #070907; border: 1px solid #3f4a3f; color: #fff; font: inherit; font-size: 14px; outline: none; user-select: text; }
.inp:focus { border-color: var(--green); }
.c-sec { margin-bottom: 8px; }
.pick-row { display: flex; gap: 8px; }
.pick-pt { width: 84px; height: 84px; background: center / cover; border: 2px solid #2c3a2c; cursor: pointer; filter: brightness(0.7); }
.pick-pt.on { border-color: var(--green); filter: none; box-shadow: 0 0 10px rgba(70,255,90,0.35); }
.pick-nation { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 8px; border: 1px solid #2c3a2c; background: #101410; cursor: pointer; }
.pick-nation span { color: var(--dim); font-size: 11px; }
.pick-nation b { font-weight: 400; color: #eaffea; }
.pick-nation.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c), 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.pn-flag { width: 40px; height: 12px; }
.stat-pick .stat-row { margin: 4px 0; }

@media (max-width: 1100px) {
  :root { --card-w: 84px; }
  .mod { grid-template-columns: 160px 1fr 250px; }
  .split { grid-template-columns: 1fr 280px; }
  .cmd { grid-template-columns: 170px 1fr; }
  .cmd > .cmd-box:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .mod { grid-template-columns: 150px 1fr; }
  .mod .part-list { grid-column: 1 / -1; max-height: none; }
  .split, .split2 { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .pmap-wrap { flex-direction: column; }
  #topbar { font-size: 11px; gap: 10px; }
  .tb-res { gap: 8px; }
}

/* ---------------------------------------------------------------- 커맨더 정보 (원작 배치) */
.win-ci { background: linear-gradient(180deg, #2a2f2a, #141814); border: 3px solid #4a544a; box-shadow: inset 0 0 0 1px #171b17, inset 0 0 0 3px #5e6a5e, 0 0 0 1px #0a0c0a, 0 8px 28px rgba(0,0,0,0.6); position: relative; }
/* 네 귀퉁이 리벳 */
.win-ci::before, .win-ci::after { content: ''; position: absolute; left: 6px; right: 6px; height: 8px; pointer-events: none; background: radial-gradient(circle, #c8d0c8 0 2px, #4a544a 2.5px, transparent 3px) left / 8px 8px no-repeat, radial-gradient(circle, #c8d0c8 0 2px, #4a544a 2.5px, transparent 3px) right / 8px 8px no-repeat; }
.win-ci::before { top: 6px; }
.win-ci::after { bottom: 6px; }
.win-plaque-sub { width: 100%; text-align: center; font-size: 11px; color: #b7c4b7; margin-top: 4px; }
.win-plaque-row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; padding: 10px 10px 4px; background: linear-gradient(180deg, #2a302a, #161a16); border-bottom: 1px solid #0a0c0a; }
.win-plaque-row .win-x { position: absolute; right: 10px; top: 10px; }
.win-plaque { padding: 6px 34px; font-size: 16px; font-weight: 700; letter-spacing: 4px; color: #ffe3b0; background: linear-gradient(180deg, #5a1a0c, #2a0a04); border: 2px solid #b8742a; box-shadow: inset 0 0 0 1px #f0b060, 0 0 0 2px #2a1a0a, 0 0 12px rgba(255,140,40,0.25); text-shadow: 0 0 6px rgba(255,160,60,0.6); border-radius: 2px; }
.win-ci .win-body { background: #0b0d0b; }
.ci { display: flex; flex-direction: column; gap: 14px; }
.ci-top { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; }
.ci-bottom { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.ci-box { position: relative; border: 1px solid #5a605a; box-shadow: inset 0 0 0 1px #1e221e, inset 0 0 0 3px #0b0d0b, inset 0 0 0 4px #3a403a; padding: 22px 12px 12px; background: linear-gradient(180deg, #121512, #0a0c0a); }
.ci-h { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 3px 22px; background: linear-gradient(180deg, #3a403a, #1a1e1a); border: 1px solid #6a726a; color: #f0f0e8; letter-spacing: 3px; font-size: 12px; white-space: nowrap; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
.ci-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.ci-tab { flex: 1; padding: 4px 0; background: #1a1e1a; color: #d8d8d0; border: 1px solid #4a504a; border-bottom-color: #0a0c0a; cursor: pointer; font-size: 12px; }
.ci-tab.on { background: #0a0c0a; color: #46ff5a; border-bottom-color: transparent; }
.ci-list { display: flex; flex-direction: column; gap: 7px; padding: 4px 4px; }
.ci-kv { display: grid; grid-template-columns: 76px 14px 1fr; color: #e8e8e0; font-size: 13px; }
.ci-k { letter-spacing: 1px; white-space: nowrap; }
.ci-c { color: #9a9a90; }
.ci-v { color: #fff; }
.ci-gem { margin-top: 10px; height: 64px; display: grid; place-items: center; background: repeating-linear-gradient(0deg, rgba(160,40,160,0.35) 0 2px, transparent 2px 5px), #0a060c; border: 1px solid #3a2a3a; }
.ci-gem img { height: 56px; filter: drop-shadow(0 0 6px rgba(80,140,255,0.7)); }
.ci-id { display: grid; grid-template-columns: 120px 1fr; gap: 10px; margin-bottom: 8px; }
.ci-pt { width: 120px; height: 120px; background: center / cover; border: 1px solid #4a504a; }
.ci-name { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #fff; }
.ci-lbl { color: #ffb020; letter-spacing: 2px; margin-top: 4px; }
.ci-points { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; margin-bottom: 8px; border: 1px solid #4a504a; background: #0a0c0a; color: #e8e8e0; letter-spacing: 2px; }
.ci-points b { color: #ffd84a; font-weight: 400; }
.ci-stat-row { display: grid; grid-template-columns: 1fr 56px 22px; align-items: center; gap: 6px; margin: 5px 0; padding: 5px 10px; border: 1px solid #3a403a; background: #0e110e; }
.ci-stat-row.changed { border-color: #46ff5a; }
.ci-sn { color: #f0f0e8; letter-spacing: 3px; font-size: 13px; }
.ci-sv { text-align: right; color: #fff; font-size: 16px; font-family: 'Galmuri11'; }
.ci-arrows { display: flex; flex-direction: column; gap: 1px; }
.ci-arrow { height: 11px; width: 20px; padding: 0; font-size: 8px; line-height: 9px; background: #2a302a; color: #cfd8cf; border: 1px solid #5a605a; cursor: pointer; }
.ci-arrow:disabled { opacity: 0.35; cursor: default; }
.ci-arrow:hover:not(:disabled) { background: #3f6a40; color: #fff; }
.ci-eff { color: var(--dim); font-size: 11px; line-height: 15px; margin-top: 6px; }
.ci-hist-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ci-sub { border: 1px solid #3a403a; padding: 26px 10px 10px; position: relative; }
.ci-sub-h { position: absolute; top: 0; left: 0; right: 0; text-align: center; padding: 3px; background: #1a1e1a; border-bottom: 1px solid #3a403a; letter-spacing: 3px; color: #e8e8e0; }
.ci-sub .ci-kv { margin: 6px 0; }
.ci-bar { height: 8px; border: 1px solid #3a4a6a; background: #05070a; margin-top: 8px; }
.ci-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2a6ad8, #6ab0ff); }
.ci-medals { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 4px; background: #070907; border: 1px solid #2a302a; }
.ribbon { width: 46px; height: 16px; border: 1px solid #1a1a1a; box-shadow: inset 0 1px 0 rgba(255,255,255,0.4); }
.ci-none { color: var(--dim); font-size: 11px; }
.ci-res-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 4px 8px; margin: 3px 0; border: 1px solid #2a302a; background: #0e110e; }
.ci-res-row img { width: 34px; height: 34px; }
.ci-rn { color: #f0f0e8; letter-spacing: 2px; font-size: 13px; }
.ci-rv { color: #fff; font-size: 13px; }
.ci-foot { display: flex; justify-content: flex-end; }
.ci-ok { padding: 8px 32px; font-size: 14px; letter-spacing: 3px; background: linear-gradient(180deg, #3a403a, #1a1e1a); border-color: #8a908a; }
@media (max-width: 900px) {
  .ci-top { grid-template-columns: 1fr 1fr; }
  .ci-bottom, .ci-hist-in { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 캐릭터 고르기 */
.avatar-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.av { position: relative; aspect-ratio: 1; background: center / cover; border: 2px solid #2c3a2c; cursor: pointer; filter: brightness(0.65); }
.av.on { border-color: var(--green); filter: none; box-shadow: 0 0 10px rgba(70,255,90,0.35); }
.av:hover { filter: none; }
.av-preview { display: flex; gap: 12px; align-items: center; margin-top: 8px; padding: 6px 10px; background: #2a2c28; border: 1px solid #3f4a3f; }
.av-preview canvas { width: 96px; height: 96px; background: url('assets/tiles/asphalt.png'); background-size: 96px; border: 1px solid #1a1e1a; }


/* ---------------------------------------------------------------- 건물 안 화면 (원작 한국판 상점식) */
#scene-layer { position: absolute; inset: 0; z-index: 18; pointer-events: none; }
.scene { position: absolute; inset: 0; pointer-events: all; background: #03070c; overflow: hidden; --panel-h: 200px; animation: scIn 0.35s ease; }
@keyframes scIn { from { opacity: 0; } to { opacity: 1; } }
.in-scene #panel-layer { z-index: 25; }
.in-scene .win-back { inset: 0; background: rgba(0,6,14,0.55); }
.in-scene #tooltip { display: none; }
.sc-bg { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--panel-h) - 20px); background: center 40% / cover no-repeat; filter: saturate(0.85); }
.sc-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0) 25%, rgba(0,0,0,0) 70%, rgba(0,4,10,0.9)); }
.scene-portal .sc-bg { background: radial-gradient(ellipse at 50% 38%, #103a6a 0%, #061426 45%, #02060c 80%); }
.sc-canvas { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: calc(100% - var(--panel-h)); }
.sc-plaque { position: absolute; left: 18px; top: 14px; padding: 7px 26px; font-size: 16px; font-weight: 700; letter-spacing: 3px; color: #dff6ff; background: linear-gradient(180deg, #1e2a36, #0a1018); border: 1px solid #5a7a90; box-shadow: inset 0 0 0 1px #0a0f14, 0 0 0 2px #26343f, 0 4px 12px rgba(0,0,0,0.6); clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%); text-shadow: 0 0 6px rgba(120,210,255,0.6); }
.sc-sub-plaque { position: absolute; left: 4%; top: calc((100% - var(--panel-h)) * 0.46); padding: 4px 12px; font-size: 12px; color: #9fe4ff; background: rgba(4,16,30,0.8); border: 1px solid #2f7ab0; display: flex; gap: 4px; align-items: center; }
.sc-page { width: 18px; height: 16px; padding: 0; font-size: 9px; color: #9fe4ff; background: #0a2036; border: 1px solid #3f8ac0; cursor: pointer; }
.sc-tabs { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--panel-h) + 14px); display: flex; gap: 10px; }
.sc-tab { padding: 6px 18px; min-width: 110px; font-size: 13px; letter-spacing: 1px; color: #7fd8ff; background: linear-gradient(180deg, rgba(10,36,64,0.9), rgba(4,14,26,0.95)); border: 1px solid #2f7ab0; box-shadow: 0 0 8px rgba(60,180,255,0.25), inset 0 0 8px rgba(60,180,255,0.15); cursor: pointer; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.sc-tab:hover { color: #fff; }
.sc-tab.on { color: #fff; background: linear-gradient(180deg, #1c6aa8, #0a2a4a); border-color: #8fe0ff; box-shadow: 0 0 14px rgba(90,210,255,0.6); }
.sc-panel { position: absolute; left: 0; right: 0; bottom: 0; height: var(--panel-h); display: grid; grid-template-columns: minmax(260px, 1.5fr) 180px minmax(210px, 1fr) 132px; gap: 8px; padding: 14px 64px 14px 14px; background: linear-gradient(180deg, #0c1a28 0%, #050c14 100%); border-top: 2px solid #3f8ac0; box-shadow: 0 -2px 0 #06101a, 0 -10px 24px rgba(0,0,0,0.7), inset 0 1px 0 rgba(140,220,255,0.3); }
.scene-hq .sc-panel, .scene-exchange .sc-panel, .scene-portal .sc-panel { grid-template-columns: minmax(300px, 2fr) minmax(220px, 1fr); }
.sc-panel > div { background: rgba(2,8,16,0.85); border: 1px solid #2a6a98; box-shadow: inset 0 0 12px rgba(40,140,220,0.15); border-radius: 2px; min-width: 0; }
.sc-npc { display: flex; gap: 10px; padding: 8px; }
.sc-npc-pt { width: 136px; flex: none; background: center / cover; border: 1px solid #3f8ac0; box-shadow: 0 0 10px rgba(60,180,255,0.3); }
.sc-npc-talk { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-npc-name { color: #7fd8ff; font-size: 12px; margin-bottom: 4px; }
.sc-say { flex: 1; overflow-y: auto; color: #e8f4ff; line-height: 19px; font-size: 13px; padding-right: 18px; scrollbar-width: thin; }
.sc-next { position: absolute; right: 0; bottom: 0; width: 22px; height: 20px; padding: 0; color: #7fd8ff; background: #0a2036; border: 1px solid #3f8ac0; cursor: pointer; font-size: 10px; }
.sc-info { display: flex; flex-direction: column; align-items: center; padding: 6px; gap: 2px; }
.sc-wt { width: 100%; display: flex; justify-content: space-between; color: #9fe4ff; font-size: 12px; padding: 0 6px; }
.sc-wt b { color: #fff; font-weight: 400; }
.sc-unit-img { flex: 1; width: 100%; background: center / contain no-repeat; min-height: 60px; }
.sc-unit-name { width: 100%; text-align: center; padding: 3px; color: #fff; border-top: 1px solid #2a6a98; font-size: 12px; }
.sc-empty { margin: auto; color: #5a8aa8; font-size: 12px; }
.sc-cost-wrap { padding: 6px 8px; display: flex; }
.sc-cost { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.sc-cost-row { display: grid; grid-template-columns: 30px 56px 1fr; align-items: center; gap: 4px; font-size: 13px; }
.sc-cost-row img { width: 26px; height: 26px; }
.sc-cn { color: #9fe4ff; }
.sc-cv { text-align: right; color: #fff; }
.sc-cost-row.short .sc-cv { color: #ff8a6a; }
.sc-btns { display: flex; flex-direction: column; gap: 4px; padding: 6px; justify-content: center; }
.sc-subrow { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 2px; }
.sc-subrow .sc-btn { padding: 3px 2px; }
.sc-btn { padding: 5px 8px; font-size: 13px; color: #cfeeff; background: linear-gradient(180deg, #123a5c, #06182a); border: 1px solid #3f8ac0; cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); letter-spacing: 1px; }
.sc-btn:hover:not(:disabled) { color: #fff; background: linear-gradient(180deg, #1c6aa8, #0a2a4a); box-shadow: 0 0 10px rgba(90,210,255,0.6); }
.sc-btn:disabled { opacity: 0.35; cursor: default; }
.sc-btn.sub { font-size: 12px; padding: 3px 8px; color: #9fd8c0; border-color: #2f7a60; background: linear-gradient(180deg, #0e3a2c, #041a12); }
.sc-btn.xs { padding: 2px 7px; font-size: 12px; }
.sc-btn.sell { border-color: #a0603a; color: #ffcfa8; background: linear-gradient(180deg, #3a2012, #180a04); }
.sc-exit { position: absolute; right: 12px; bottom: 14px; width: 42px; height: 42px; padding: 7px; background: linear-gradient(180deg, #123a5c, #06182a); border: 1px solid #3f8ac0; cursor: pointer; z-index: 2; }
.sc-exit svg { width: 100%; height: 100%; fill: none; stroke: #7fd8ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-exit:hover { box-shadow: 0 0 12px rgba(90,210,255,0.7); }
.sc-board { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: min(920px, calc(100vw - 40px)); max-height: calc(100% - var(--panel-h) - 84px); display: flex; flex-direction: column; background: rgba(2,8,16,0.9); border: 1px solid #3f8ac0; box-shadow: 0 0 0 2px #06101a, 0 0 24px rgba(40,140,220,0.35); }
.sc-board-tabs { display: flex; gap: 6px; padding: 8px 10px 0; }
.sc-board-tabs .sc-tab { min-width: 0; }
.sc-board-body { padding: 16px 12px 12px; overflow: auto; scrollbar-width: thin; }
.sc-hq-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 14px; align-content: center; }
.sc-hq-stats div { display: flex; justify-content: space-between; border-bottom: 1px solid #12344e; padding: 4px 0; }
.sc-hq-stats span { color: #7fd8ff; }
.sc-hq-stats b { color: #fff; font-weight: 400; }
.sc-ex { width: min(640px, calc(100vw - 40px)); left: auto; right: 4%; transform: none; padding: 12px; }
.sc-ex-head, .sc-ex-row { display: grid; grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr 1.9fr; align-items: center; gap: 6px; padding: 7px 6px; }
.sc-ex-head { color: #7fd8ff; border-bottom: 1px solid #2a6a98; font-size: 12px; }
.sc-ex-row { border-bottom: 1px solid #0f2a40; color: #fff; }
.sc-ex-name { display: flex; align-items: center; gap: 6px; }
.sc-ex-name img { width: 30px; height: 30px; }
.sc-ex-btns { display: flex; gap: 3px; justify-content: flex-end; flex-wrap: wrap; }
.sc-ex-money { display: flex; align-items: center; gap: 8px; padding: 10px 6px 2px; color: #9fe4ff; }
.sc-ex-money img { width: 28px; }
.sc-ex-money b { margin-left: auto; color: #ffd84a; font-weight: 400; font-size: 15px; }
.sc-portal-ring { position: absolute; left: 6%; top: 60px; width: 38%; max-width: 520px; filter: drop-shadow(0 0 30px rgba(60,160,255,0.6)); animation: portalPulse 3s ease-in-out infinite; }
.sc-portal-ring img { width: 100%; }
@keyframes portalPulse { 50% { filter: drop-shadow(0 0 50px rgba(90,200,255,0.9)); } }
.sc-planets { width: min(520px, 50vw); left: auto; right: 4%; transform: none; padding: 10px; gap: 4px; }
.sc-planet { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid #12344e; cursor: pointer; }
.sc-planet:hover { border-color: #3f8ac0; background: rgba(20,60,100,0.35); }
.sc-planet.here { border-color: #3fa060; }
.sc-planet b { color: #fff; font-weight: 400; }
.sc-planet span { color: #9fc4dc; font-size: 12px; }
@media (max-width: 900px) {
  .scene { --panel-h: 250px; }
  .sc-panel { grid-template-columns: 1fr 150px; grid-template-rows: 1fr 1fr; padding-right: 60px; }
  .sc-npc { grid-column: 1 / -1; }
  .sc-cost-wrap, .sc-btns { display: none; }
  .scene-shop .sc-cost-wrap { display: flex; }
  .scene-shop .sc-panel { grid-template-columns: 1fr 1fr 110px; }
  .scene-shop .sc-btns { display: flex; }
  .scene-hq .sc-panel, .scene-exchange .sc-panel, .scene-portal .sc-panel { grid-template-rows: 1fr; }
  .sc-npc-pt { width: 96px; }
  .sc-tab { min-width: 80px; padding: 5px 10px; font-size: 12px; }
}

/* 실내 화면 위의 창 · 입장 창: 파란 네온 테마 */
.sc-res-slot { display: flex; }
.sc-res-slot .sc-cost-wrap { flex: 1; border: 0; }
.in-scene .win:not(.win-ci), .win.win-neon { background: linear-gradient(180deg, #0c1a28, #050c14); box-shadow: 0 0 0 1px #3f8ac0, 0 0 0 3px #06101a, 0 0 28px rgba(40,140,220,0.35); border: 0; }
.in-scene .win:not(.win-ci) .win-title, .win.win-neon .win-title { background: linear-gradient(180deg, #16324c, #0a1a2a); border-bottom: 1px solid #2a6a98; }
.in-scene .win:not(.win-ci) .win-title b, .win.win-neon .win-title b { color: #dff6ff; text-shadow: 0 0 6px rgba(120,210,255,0.5); }
.in-scene .win:not(.win-ci) .win-dot, .win.win-neon .win-dot { background: #5fd0ff; box-shadow: 0 0 6px #5fd0ff; }
.in-scene .win:not(.win-ci) .win-body, .win.win-neon .win-body { background: linear-gradient(180deg, #07111c, #03080e); }
.in-scene .win:not(.win-ci) .win-x, .win.win-neon .win-x { color: #7fd8ff; border-color: #3f8ac0; background: #0a2036; }
.in-scene .win:not(.win-ci) .btn, .win.win-neon .btn { background: linear-gradient(180deg, #123a5c, #06182a); border-color: #3f8ac0; color: #dff6ff; }
.in-scene .win:not(.win-ci) .btn:hover:not(:disabled), .win.win-neon .btn:hover:not(:disabled) { background: linear-gradient(180deg, #1c6aa8, #0a2a4a); border-color: #8fe0ff; box-shadow: 0 0 10px rgba(90,210,255,0.5); }
.in-scene .win:not(.win-ci) .win-body h4, .win.win-neon .win-body h4, .in-scene .win .pl-head { color: #7fd8ff; }
.in-scene .win .unit-list, .in-scene .win .part-list, .in-scene .win .slot, .in-scene .win .row, .win.win-neon .row, .win.win-neon .mon { background: rgba(4,14,26,0.85); border-color: #17405e; }
.in-scene .win .ul-row.on, .in-scene .win .slot.on, .in-scene .win .part.on { background: #0f3150; box-shadow: inset 3px 0 0 #5fd0ff; border-color: #3f8ac0; }
.in-scene .win .pl-head { background: #0a2036; }
.in-scene .win .cap-bar i { background: linear-gradient(90deg, #1c6aa8, #5fd0ff); }
.in-scene .win .p-tech { color: #ffd84a; }

/* 점령전 */
.pmap { width: 480px; height: 480px; cursor: pointer; }
.pmap-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0; color: #cfe; font-size: 12px; }
.pmap-info { margin-top: 8px; padding: 8px; border: 1px solid #2a6a98; background: rgba(4,14,26,0.8); line-height: 18px; min-height: 70px; }
.pmap-info b { color: #fff; font-weight: 400; }
.pmap-wrap { display: flex; gap: 14px; align-items: flex-start; }
.pmap-left { display: flex; flex-direction: column; gap: 6px; }
.pmap-side { width: 300px; display: flex; flex-direction: column; gap: 8px; }
.pmap-sub { padding: 3px 10px; font-size: 12px; letter-spacing: 2px; color: #ffe3b0; background: linear-gradient(180deg, #5a1a0c, #2a0a04); border: 1px solid #b8742a; text-align: center; }
.pmap-hover { height: 16px; font-size: 11px; color: #b7c4b7; }
.pmap-res { display: flex; gap: 14px; padding: 6px 10px; background: #0e120e; border: 1px solid #2c342c; font-size: 12px; color: #eaffea; }
.pmap-res span { display: inline-flex; align-items: center; gap: 4px; }
.pmap-res img { width: 16px; height: 16px; }
.pi-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pi-head img { width: 40px; height: 40px; }
.pi-alert { margin: 6px 0; padding: 6px 8px; border: 1px solid #a0503a; background: rgba(120,30,20,0.35); color: #ffd0c0; font-size: 12px; line-height: 16px; }
.pi-btns { display: flex; gap: 6px; margin-top: 8px; }
.pmap-info { border-color: #3a463a; background: #0e120e; }
/* 유닛 배치화면 (F7): 원판 */
.dep-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dep-sort { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--dim); }
.dep-disc { position: relative; height: 330px; margin: 0 auto; width: min(640px, 100%); background: radial-gradient(ellipse at 50% 50%, #1e2a2e 0%, #10171a 55%, #0a0e10 72%, transparent 73%); }
.dep-disc::before { content: ''; position: absolute; left: 8%; right: 8%; top: 6%; bottom: 6%; border: 2px solid #3f6a7a; border-radius: 50%; box-shadow: 0 0 18px rgba(80,180,220,0.25), inset 0 0 40px rgba(60,140,180,0.15); }
.dep-slot { position: absolute; width: 74px; height: 88px; margin: -44px 0 0 -37px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; background: rgba(6,12,16,0.85); border: 1px solid #3f6a7a; cursor: pointer; }
.dep-slot:hover { border-color: #8fe0ff; }
.dep-slot.empty { cursor: default; border-style: dashed; opacity: 0.8; }
.dep-slot.locked { opacity: 0.35; }
.dep-key { position: absolute; left: -1px; top: -1px; width: 18px; height: 16px; font-size: 11px; line-height: 16px; text-align: center; background: #ffd23a; color: #000; }
.dep-empty { width: 44px; height: 44px; display: grid; place-items: center; font-size: 10px; color: #6a7a80; margin-top: 12px; }
.dep-lv { font-size: 11px; color: #cfe; }
.dep-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: #8fe0ff; font-size: 12px; }
.dep-center b { display: block; font-size: 20px; color: #fff; }
.dep-info { display: flex; flex-wrap: wrap; gap: 6px 14px; min-height: 22px; padding: 6px 10px; margin: 6px 0; background: #0e120e; border: 1px solid #2c342c; font-size: 12px; color: #eaffea; }
.dep-info b { color: #fff; }
.dep-sub { font-size: 12px; color: var(--dim); margin: 4px 0; }
.dep-wait { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scrollbar-width: thin; }
.dep-item { flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; background: #111811; border: 1px solid #2c342c; font-size: 11px; color: #eaffea; cursor: pointer; }
.dep-item:hover { border-color: #8fe0ff; }
.dep-item.dead { opacity: 0.5; }
/* 전투 결과 창 (한국 공식 화면 배치) */
.rs-head { text-align: center; color: #c9d9c3; font-size: 12px; margin-bottom: 10px; }
.rs-grid { display: grid; grid-template-columns: 300px 1fr; gap: 14px; }
.rs-sec { padding: 3px 10px; font-size: 12px; letter-spacing: 3px; color: #ffe3b0; background: linear-gradient(180deg, #5a1a0c, #2a0a04); border: 1px solid #b8742a; text-align: center; margin: 6px 0; }
.rs-sec.win { background: linear-gradient(180deg, #1c5a2c, #0a2a10); border-color: #4aa860; color: #d8ffd8; }
.rs-sec.lose { background: linear-gradient(180deg, #5a1c1c, #2a0a0a); border-color: #a0503a; color: #ffd8d0; }
.rs-cmd { display: flex; gap: 10px; align-items: center; }
.rs-cmd img { width: 64px; height: 64px; border: 1px solid #4a544a; }
.rs-cmd b { color: #fff; font-weight: 400; }
.rs-divs { display: flex; flex-direction: column; gap: 4px; }
.rs-div { display: grid; grid-template-columns: 44px 48px 1fr; gap: 8px; align-items: center; font-size: 12px; }
.rs-div b { color: #fff; font-weight: 400; }
.rs-div .hpbar { width: auto; }
.rs-res { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #ffe07a; }
.rs-res span { display: inline-flex; align-items: center; gap: 3px; }
.rs-res span.zero { color: #5a6a5a; }
.rs-res img { width: 16px; height: 16px; }
.rs-units { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; scrollbar-width: thin; }
.rs-unit { padding: 4px 8px; background: #111811; border: 1px solid #222c22; }
.rs-unit.dead { opacity: 0.7; }
.rs-u-top { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 3px; }
.rs-u-top b { color: #eaffea; font-weight: 400; }
.rs-u-top span { color: var(--dim); }
.rs-u-top span.ok { color: #7dff8a; margin-left: auto; }
.rs-u-top span.dead { color: #ff8a6a; margin-left: auto; }
.rs-unit .hpbar { width: auto; }
.atk-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.atk-head img { width: 64px; height: 64px; }
.atk-head b { font-size: 16px; color: #fff; font-weight: 400; }
.res-head { text-align: center; padding: 10px; margin-bottom: 10px; border: 1px solid #2a6a98; }
.res-head.win { background: linear-gradient(180deg, rgba(40,120,60,0.35), transparent); border-color: #4aa860; }
.res-head.lose { background: linear-gradient(180deg, rgba(140,40,30,0.35), transparent); border-color: #a0503a; }
.res-title { font-size: 26px; letter-spacing: 8px; color: #fff; text-shadow: 0 0 10px rgba(120,210,255,0.6); margin-bottom: 4px; }
.res-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.res-table th { color: #7fd8ff; font-weight: 400; text-align: left; padding: 5px; border-bottom: 1px solid #2a6a98; }
.res-table td { padding: 5px; border-bottom: 1px solid #0f2a40; color: #eaf6ff; }
.res-table td.ok { color: #7dff8a; }
.res-table td.dead { color: #ff8a6a; }
.res-reward { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0; color: #7fd8ff; }
.res-reward span { color: #ffe07a; }

/* 연구소: 상위 차체 업그레이드 창 · 지수를 채운 유닛의 버튼 */
.btn.hot { border-color: #ffd84a; color: #fff3c0; box-shadow: 0 0 8px rgba(255,216,74,0.45), inset 0 1px 0 rgba(255,255,255,0.15); }
.in-scene .win:not(.win-ci) .btn.hot, .win.win-neon .btn.hot { border-color: #ffd84a; }
.up-cur { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.up-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; min-width: 0; align-items: start; }
.up-card { border: 1px solid #3a4f3a; background: rgba(0,0,0,0.25); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.up-card.locked { opacity: 0.8; }
.up-card .p-why { color: #ff9a7a; font-size: 12px; }
.up-split { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; align-items: start; }
@media (max-width: 900px) { .up-split { grid-template-columns: 1fr; } }
/* 건물 안(전체 화면 장면)에서는 HUD 가 가려지므로 창을 화면 높이만큼 쓴다 */
.in-scene .win { max-height: calc(100vh - 24px); }

/* ---------------------------------------------------------------- 커맨더 등록 4단계 (행성 → 국가 → 캐릭터 → 특성치) */
.create { width: 800px; }
.create:focus { outline: none; }
.pick-planets { flex-wrap: wrap; }
.pick-planets .pick-planet { flex: 1 1 calc(25% - 8px); min-width: 150px; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 8px; border: 1px solid #2c3a2c; background: #101410; cursor: pointer; text-align: center; }
.pick-planet b { font-weight: 400; color: #eaffea; }
.pick-planet span { color: var(--dim); font-size: 11px; line-height: 15px; }
.pick-planet .tag { font-size: 10px; padding: 1px 6px; margin-top: 2px; }
.pick-planet:hover:not(.locked) { border-color: #5a8a5a; }
.pick-planet.on { border-color: var(--green); box-shadow: 0 0 10px rgba(70,255,90,0.35); background: #182a19; }
.pick-planet.locked { opacity: 0.45; cursor: not-allowed; }
.pn-head { display: flex; gap: 6px; align-items: center; }
.pn-emblem { width: 28px; height: 28px; }
.pn-map { width: 64px; height: 64px; image-rendering: pixelated; border: 1px solid #1a1e1a; }
.cr-disc { height: 330px; }
.cr-slot { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.cr-slot.on { border-color: #ffd23a; box-shadow: 0 0 10px rgba(255,210,58,0.45); }
.cr-center canvas { display: block; width: 160px; height: 160px; margin: 0 auto 4px; background: url('assets/tiles/asphalt.png'); background-size: 96px; border: 1px solid #1a1e1a; }
.cr-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cr-step { color: var(--dim); }
.cr-summary div { color: #eaffea; }
/* 드롭쉽 탑승 중 표시: HUD 카드(hud.js 가 .aboard 를 붙인다) · F7 원판 슬롯 */
.card.aboard .card-img { opacity: 0.45; }
.card.aboard .card-name { color: #8fe0ff; }
.dep-slot.aboard { border-color: #5ac8ff; }
.dep-aboard { position: absolute; right: -1px; top: -1px; font-size: 10px; line-height: 16px; padding: 0 4px; background: #5ac8ff; color: #000; }
