:root {
  --bg: #0f1a22; --panel: rgba(14, 24, 32, 0.86); --panel2: rgba(24, 38, 50, 0.92);
  --line: rgba(160, 200, 220, 0.18); --text: #dce8ee; --dim: #8ea6b3; --accent: #7fd4ff;
  --buff: #6fd58b; --debuff: #ff7b6b; --warn: #f2c14e; --player: #9fd2ff; --enemy: #ffb1a3;
  --ok: #6fd58b; --light: #f2c14e; --serious: #ff9b55; --critical: #ff5a5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 "Segoe UI", "Malgun Gothic", sans-serif; overflow: hidden; }
#app { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(4px); }
button { font: inherit; color: var(--text); background: #22384a; border: 1px solid #36546a; border-radius: 6px; padding: 4px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover { background: #2c4960; }
button.on { background: #2f6a8f; border-color: var(--accent); }
button.big { padding: 8px 16px; font-weight: 600; }
button svg { width: 16px; height: 16px; flex: none; }
.ico { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }

/* 위 막대 */
#topbar { position: absolute; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: linear-gradient(#0c151cf0, #0c151cc0); border-bottom: 1px solid var(--line); z-index: 5; }
.tb-group { display: flex; gap: 4px; align-items: center; }
.tb-clock { font: 600 18px/1 Consolas, monospace; min-width: 70px; text-align: center; }
.tb-spacer { flex: 1; }
.tb-wind { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.tb-wind svg { width: 30px; height: 30px; }
/* 11-30 PC 위 띠가 꽉 차면 단추 글자가 2~3줄로 꺾였음(×0.5 단추 · ♫ 단추가 늘어난 뒤) → 단추는 안 꺾고, 남는 폭은 바람 글이 줄어들며(…) 내줌 */
#topbar button, #topbar .tb-group > * { white-space: nowrap; flex: none; }
#topbar .tb-group, #topbar .tb-clock { flex: none; }
#topbar .tb-wind { flex: 0 1 auto; min-width: 0; overflow: hidden; }
#topbar .tb-wind > :not(svg) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .tb-wind > svg { flex: none; }
#topbar .tb-wind { min-width: 150px; } /* 바람은 늘 보여야 함 — 줄어도 화살표 + 앞 글자는 남김 */
/* 좁은 PC(1600 아래): 오른쪽 메뉴 단추 · '여기서부터 다시 하기'는 아이콘만(글은 마우스를 올리면 툴팁) */
@media (max-width: 1599px) { body:not(.small) #topbar .tbl { display: none; } }

/* 세력 요약 — 12-01 기본 1줄 슬림 배지 + 클릭 시 상세 펼침(기함 신호기 #flagSigBar 겹침 원천 차단) */
#force { top: 52px; left: 10px; padding: 5px 10px; max-width: 440px; z-index: 8; cursor: pointer; user-select: none; }
#force .f-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
#force .f-grid { display: none; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); grid-template-columns: auto 1fr 1fr; gap: 3px 10px; align-items: start; font-size: 11.5px; }
#force.open .f-grid { display: grid; }
#force .h { font-weight: 700; }
#force .p { color: var(--player); } #force .e { color: var(--enemy); }
#force .k { color: var(--dim); display: flex; gap: 5px; align-items: center; white-space: nowrap; }

/* 고른 배 — 12-01 폭 278px 슬림화 + 접기 토글(.folded) */
#shipPanel { top: 52px; right: 10px; width: 278px; bottom: 90px; overflow-y: auto; padding: 8px; z-index: 8; }
#shipPanel.folded { bottom: auto; width: auto; padding: 5px 10px; overflow: visible; }
#shipPanel .sp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#shipPanel .sp-fold { padding: 1px 6px; font-size: 11px; min-height: 22px; flex: none; }
.sec { margin: 6px 0 3px; font-weight: 700; font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.row { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 12px; }
.row .lab { width: 82px; color: var(--dim); flex: none; }
.bar { flex: 1; height: 9px; background: #0b1218; border-radius: 3px; position: relative; overflow: hidden; border: 1px solid #22323e; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); }
.bar > b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; }
.val { width: 58px; text-align: right; font-family: Consolas, monospace; flex: none; font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 4px; border-radius: 12px; background: #1b2a35; border: 1px solid; font-size: 12px; cursor: default; }
.chip.buff { border-color: var(--buff); color: var(--buff); }
.chip.debuff { border-color: var(--debuff); color: var(--debuff); }
/* (11-24 고침) 전엔 background: currentColor + color: #0d161c → 바탕도 남색이 되어 숫자가 안 보였음 */
.chip .n { background: rgba(255, 255, 255, 0.16); color: #fff; border-radius: 8px; padding: 0 6px; font-weight: 800; font-size: 12px; min-width: 18px; text-align: center; }
.chip.debuff .n { background: var(--debuff); color: #1a0d0b; }
.chip.buff .n { background: var(--buff); color: #0b1a10; }
.hullfig { display: flex; gap: 6px; align-items: center; }
.hullfig svg { width: 82px; height: 50px; flex: none; }
.masts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.mast { background: #14212b; border-radius: 6px; padding: 4px; border: 1px solid #22323e; }
.mast .t { font-size: 11px; color: var(--dim); }
.mast .bar { height: 7px; margin: 2px 0; }
.off { display: grid; grid-template-columns: 118px 1fr auto; gap: 1px 6px; font-size: 12px; align-items: center; }
.off .oslot { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.off .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; padding: 0 5px; border-radius: 8px; border: 1px solid; white-space: nowrap; }
.tag.ok { color: var(--ok); } .tag.light { color: var(--light); } .tag.serious { color: var(--serious); } .tag.critical { color: var(--critical); }
.tag.act { color: var(--accent); } .tag.pen { color: var(--warn); } .tag.vac { color: var(--dim); }
.note { color: var(--dim); font-size: 11px; }
.tmp { color: var(--warn); font-size: 10px; border: 1px solid var(--warn); border-radius: 6px; padding: 0 4px; margin-left: 4px; }

/* 기록 — 12-01 폭 268px · 높이 110px 슬림화(1280px에서도 #cmd와 비충돌) */
#log { left: 10px; bottom: 90px; width: 268px; max-height: 112px; overflow-y: auto; padding: 5px 7px; font-size: 11.5px; opacity: 0.86; transition: opacity .15s; z-index: 7; }
#log:hover { opacity: 1; }
#log .l { display: flex; gap: 5px; } #log .l .tm { color: var(--dim); font-family: Consolas, monospace; flex: none; }
#log .l.player { color: var(--player); } #log .l.enemy { color: var(--enemy); } #log .l.sys { color: var(--warn); }

/* 명령 — 12-01 슬림화 · 키/돛 한 줄 합침 · 하단 90px 정렬 */
#cmd { left: 50%; transform: translateX(-50%); bottom: 90px; padding: 5px 8px; display: flex; flex-direction: column; gap: 4px; align-items: center; z-index: 8; max-width: calc(100vw - 576px); }
#cmd .r { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
#cmd .r.nav-pair { gap: 8px; }
#cmd .nav-grp { display: inline-flex; align-items: center; gap: 4px; }
#cmd button { padding: 2px 7px; font-size: 12px; gap: 4px; }
#cmd .lbl { color: var(--dim); font-size: 11.5px; white-space: nowrap; }
#cmd input[type=range] { width: 110px; }

/* 함선 카드 — 12-01 높이 84px 슬림 가로 스트립(시야 대폭 확보 · 말줄임 · 이상 없음 줄 숨김) */
#cards { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; display: flex; gap: 6px; padding: 6px 8px; background: linear-gradient(#0c151c88, #0c151cf2); border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; z-index: 9; }
.card { width: 222px; flex: none; background: var(--panel2); border: 1px solid #36546a; border-radius: 7px; padding: 5px 7px; cursor: pointer; user-select: none; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card .t { font-weight: 700; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.card .t > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card .t > .c { flex: none; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.card .c { color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.card .c.fl0 { display: none !important; }
.card .row { margin: 0; gap: 4px; }
.card.enemy { border-color: #6a3a36; }

/* 조절판 */
#tune { top: 96px; left: 10px; width: 320px; bottom: 90px; overflow-y: auto; padding: 10px; z-index: 12; }
#tune label { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
#tune .sl { display: grid; grid-template-columns: 1fr 70px; gap: 2px 8px; align-items: center; margin: 4px 0; }
#tune .sl input { grid-column: 1 / 3; width: 100%; }

/* 덮는 창 */
.overlay { position: absolute; inset: 0; background: rgba(5, 10, 14, 0.82); z-index: 20; display: flex; align-items: center; justify-content: center; }
.dlg { background: #13212b; border: 1px solid #36546a; border-radius: 10px; padding: 16px; max-width: 1100px; width: calc(100% - 32px); max-height: calc(100% - 40px); overflow: auto; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg h3 { margin: 12px 0 6px; font-size: 14px; color: var(--accent); }

/* 배정 화면 */
.as-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 14px; }
.slotgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { background: #182a36; border: 1px solid #2c4456; border-radius: 8px; padding: 6px; cursor: pointer; min-height: 56px; }
.slot:hover { border-color: #4d7896; }
.slot.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* 11-25 디디님 피드백: 배정된 두 장교 자리 바꾸기 */
.slot.swapfrom { border-color: #ffd36b; box-shadow: 0 0 0 2px #ffd36b inset; }
.slot.swapok { border-color: #5fd38a; background: #1a3328; }
.slot.swapno { opacity: 0.45; border-color: #a85050; }
.slot.dragover { border-color: #ffd36b; background: #2a3a20; }
.swapbar { background: #2b2a18; border: 1px solid #ffd36b; border-radius: 6px; padding: 6px 8px; margin: 6px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot .sn { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 4px; }
.slot .pn { font-weight: 600; }
.slot.empty .pn { color: #61798a; font-weight: 400; }
.roster { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.person { background: #182a36; border: 1px solid #2c4456; border-radius: 8px; padding: 5px 8px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; }
.person.no { opacity: 0.35; cursor: not-allowed; }
.person.pen { border-color: var(--warn); }
.person .rk { font-size: 11px; color: var(--dim); }
.stats { display: flex; gap: 3px; grid-column: 1 / 3; }
.stats span { font-size: 10px; color: var(--dim); display: flex; align-items: center; gap: 2px; }
.stats i { display: inline-block; height: 5px; background: var(--accent); border-radius: 2px; }

#tip { position: absolute; z-index: 40; max-width: 320px; background: #0b141b; border: 1px solid #4d7896; border-radius: 6px; padding: 6px 8px; pointer-events: none; font-size: 12px; }
.kbd { font-family: Consolas, monospace; border: 1px solid #4d7896; border-radius: 4px; padding: 0 4px; }
table.rep { border-collapse: collapse; width: 100%; }
table.rep td, table.rep th { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }

/* Under Fire 스택 칸 · 흐름 */
.ufcells { display: flex; gap: 3px; align-items: center; margin: 4px 0; }
.ufcells i { width: 16px; height: 16px; border-radius: 3px; background: #1b2a35; border: 1px solid #3a5263; }
.ufcells i.supz { border-color: #7a3a36; }
.ufcells i.on { background: var(--serious); border-color: var(--serious); }
.ufcells i.on.sup { background: var(--critical); border-color: var(--critical); }
.ufcells .ufn { margin-left: 6px; font: 700 18px/1 Consolas, monospace; color: var(--serious); }
.ufcells .ufn small { font-size: 11px; color: var(--dim); }
.ufhist { position: relative; display: flex; align-items: flex-end; gap: 1px; height: 40px; background: #0b1218; border: 1px solid #22323e; border-radius: 4px; padding: 2px; margin-top: 4px; }
.ufhist i { flex: 1; min-width: 1px; border-radius: 1px 1px 0 0; }
.ufhist b { position: absolute; left: 0; right: 0; bottom: calc(2px + 75% * (36 / 40)); border-top: 1px dashed rgba(255, 90, 90, 0.6); }
.cardstk { display: inline-flex; align-items: center; gap: 2px; color: var(--serious); font-weight: 700; }

/* 군의관 치료 */
.healbox { background: #14212b; border: 1px solid #22323e; border-radius: 6px; padding: 5px 7px; margin: 4px 0; }
.healres { font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-top: 3px; }
.healres.ok { color: var(--buff); background: rgba(111, 213, 139, 0.12); }
.healres.fail { color: var(--critical); background: rgba(255, 90, 90, 0.12); }

/* 접고 펴는 칸 */
.sec.fh { cursor: pointer; user-select: none; }
.sec.fh:hover { color: #bfe9ff; }
.sec.fh .fa { width: 12px; display: inline-block; color: var(--dim); }
.sec.fh .fsum { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--dim); white-space: nowrap; }
.fb { margin-bottom: 4px; }

/* ===== 장면(11-24 저녁): 타이틀 · 세계 지도 · 항구 ===== */
.scene { position: absolute; inset: 0; display: none; }
body[data-scene="title"] #scene-title, body[data-scene="world"] #scene-world, body[data-scene="lobby"] #scene-lobby { display: block; }
/* 11-25 멀티: 그 화면에서만 상태를 바꾸는 단추는 숨김(장교 배정 · 조절판 = 다른 사람과 어긋남) · 시간 단추는 방장만 */
body.multi #bAssign, body.multi #bTune, body.multi #tune, body.multi:not(.mhost) #timeCtl button, body.multi #timeCtl .sp[data-s="16"] { display: none !important; }
#scene-lobby { background: radial-gradient(circle at 70% 30%, #26394a, #0b141b); overflow: auto; }
#scene-lobby .lobby { margin: 8vh auto; max-width: 620px; }
#scene-lobby input { background: #0b141b; color: #eaf3f7; border: 1px solid #36546a; border-radius: 6px; padding: 6px 8px; flex: 1; min-width: 0; }
body:not([data-scene="battle"]) #view, body:not([data-scene="battle"]) #topbar, body:not([data-scene="battle"]) #force,
body:not([data-scene="battle"]) #shipPanel, body:not([data-scene="battle"]) #log, body:not([data-scene="battle"]) #cmd,
body:not([data-scene="battle"]) #cards, body:not([data-scene="battle"]) #tune { display: none !important; }
button:disabled { opacity: 0.45; cursor: default; }
.kbd { display: inline-block; padding: 0 5px; border: 1px solid #4a6a80; border-bottom-width: 2px; border-radius: 4px; font: 11px Consolas, monospace; color: var(--text); background: #12202a; }
.good { color: var(--ok); } .bad { color: var(--critical); }

/* 타이틀 */
#titleBg { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-box { position: absolute; left: 8vw; top: 12vh; display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.t-name { font: 800 64px/1 Georgia, "Times New Roman", serif; letter-spacing: 10px; color: #f3e6cf; text-shadow: 0 4px 18px #000a; }
.t-sub { color: #d9c7a8; font-size: 15px; margin-bottom: 18px; text-shadow: 0 2px 6px #000; }
.t-menu { display: flex; flex-direction: column; gap: 8px; width: 340px; }
.t-menu button { justify-content: flex-start; font-size: 16px; background: rgba(20, 34, 46, 0.82); }
.t-menu button .kbd { margin-left: auto; }
.t-foot { position: fixed; left: 8vw; bottom: 18px; color: #c9b593; font-size: 12px; text-shadow: 0 1px 4px #000; }

/* 세계 지도 */
#worldView { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
#wTop { position: absolute; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 10px; background: linear-gradient(#0c151cf0, #0c151cc0); border-bottom: 1px solid var(--line); z-index: 5; }
#wTop button { white-space: nowrap; flex-shrink: 0; } /* 11-30 17:4x 그림(ships_ports pc_port_fleet): 항구 창이 열린 PC 세계 상단 바에서 배속 버튼 글이 '1/분' · '1시/간'으로 꺾였음 */
.wstat { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.wstat.badc { color: var(--critical); }
.xpbar { display: inline-block; width: 70px; height: 8px; background: #0b1218; border: 1px solid #22323e; border-radius: 3px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--warn); }
#wDivs { top: 54px; left: 10px; width: 290px; max-height: 44vh; overflow-y: auto; padding: 8px 10px; }
#wOrders { left: 10px; width: 290px; top: calc(54px + 44vh + 8px); max-height: calc(100vh - 54px - 44vh - 60px); overflow-y: auto; padding: 8px 10px; }
#wInfo { top: 54px; right: 10px; width: 320px; padding: 8px 10px; max-height: calc(100vh - 120px); overflow-y: auto; }
#wInfo button { margin-top: 6px; }
#wLog { left: 310px; right: 300px; bottom: 40px; padding: 6px 10px; font-size: 12px; max-height: 120px; overflow: hidden; }
#wHint { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; display: flex; align-items: center; justify-content: center; gap: 4px; background: #0c151cd8; border-top: 1px solid var(--line); font-size: 13px; }
.divrow { padding: 6px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; margin-bottom: 4px; }
.divrow.cur { border-color: var(--accent); background: #18303f; }
.shiprow { margin: 4px 0 2px 6px; font-size: 13px; }
.mini { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 12px; }
.mini span { display: inline-flex; align-items: center; gap: 3px; }
.mb { display: inline-block; width: 44px; height: 7px; background: #0b1218; border: 1px solid #22323e; border-radius: 3px; overflow: hidden; }
.mb b { display: block; height: 100%; }
.ord { padding: 5px 6px; border-left: 3px solid var(--accent); background: #13222c; margin: 4px 0; border-radius: 3px; font-size: 13px; }
.ord.done { border-left-color: var(--ok); } .ord.sent { border-left-color: var(--warn); }
.big2 { font-size: 18px; font-weight: 700; margin: 4px 0; }
#wInfo .row .lab { width: 86px; }

/* 항구 */
.dlg.port { width: min(1180px, 96vw); max-width: none; height: min(760px, 92vh); display: flex; flex-direction: column; }
.ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pbody { flex: 1; display: flex; gap: 12px; min-height: 0; }
.pbody nav { width: 210px; display: flex; flex-direction: column; gap: 4px; }
.ptab { justify-content: flex-start; }
.ptab.off { opacity: 0.45; }
.pmain { flex: 1; overflow-y: auto; padding-right: 6px; }
.pmsg { margin: 6px 0; padding: 6px 8px; background: #13222c; border-radius: 6px; }
.bar.inl { display: inline-block; width: 70px; vertical-align: middle; }
.pools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pool { background: #14212b; border: 1px solid #22323e; border-radius: 8px; padding: 8px; }
.pool button { margin-top: 6px; }
.gm { display: flex; flex-direction: column; gap: 8px; }
#gameMenu { z-index: 30; } #help { z-index: 25; }
#fbDlg { position: fixed; z-index: 80; } /* 11-25 디디님 피드백: 피드백 창은 전체 화면 · 패널 단추(40)보다 위 — 뒤 단추가 안 눌리게 */

/* 11-25 항구 메뉴 = 오른쪽 판 — 왼쪽에 잔교에 정박한 배 · 항구(1:1 3D)가 보이게(사용자 00:02 "선착장에 정박하는 형식") */
#port.overlay { left: auto; right: 0; width: min(760px, 58vw); background: linear-gradient(90deg, rgba(5,10,14,0) 0, rgba(5,10,14,0.55) 24px); padding: 10px 10px 10px 24px; justify-content: stretch; align-items: stretch; }
#port .dlg.port { width: 100%; height: 100%; max-height: none; background: rgba(19,33,43,0.96); }
#port .pbody { flex-direction: column; }
#port .pbody nav { width: auto; flex-direction: row; flex-wrap: wrap; }
#port .pbody nav > div[style*="flex:1"] { display: none; }
#port .ptab { flex: 1 1 30%; font-size: 12px; padding: 5px 6px; }

/* ===== 11-25 핸드폰(작은 화면 · 터치) — 사용자 "모바일 버전으로 포팅" ===== */
canvas#view, canvas#worldView { touch-action: none; }
#panelToggle { display: none; position: fixed; right: 10px; bottom: 44px; z-index: 40; padding: 8px 12px; font-weight: 700; box-shadow: 0 2px 8px #0008; }
body.small[data-scene="world"] #panelToggle, body.small[data-scene="battle"] #panelToggle { display: inline-flex; }
#touchRing { position: fixed; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 3px solid rgba(127,212,255,0.85); pointer-events: none; z-index: 60; opacity: 0; transform: scale(0.3); }
#touchRing.fill { opacity: 0.8; transform: scale(1); transition: transform 0.45s linear, opacity 0.1s; }
#touchRing.done { opacity: 1; transform: scale(1.15); border-color: #ffe28a; background: rgba(255,226,138,0.18); transition: transform 0.1s; }
body.small { font-size: 12px; }
body.small button { padding: 5px 8px; }
body.small button.big { padding: 7px 10px; }
/* 맨 위 줄 = 옆으로 밀어 봄 */
body.small #wTop, body.small #topbar { overflow-x: auto; overflow-y: hidden; gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.small #wTop > *, body.small #topbar > * { flex: none; }
body.small #wTop .tb-spacer, body.small #topbar .tb-spacer { display: none; }
/* 세계: 판은 접어 둠 · 고른 대상 정보 = 아래 띠 */
body.small #wHint { display: none; }
body.small #wDivs, body.small #wOrders, body.small #wLog { display: none; }
body.small #wInfo { top: auto; left: 8px; right: 8px; width: auto; bottom: 8px; max-height: 30vh; padding: 6px 10px 6px 10px; }
body.small #wInfo .note[style] { display: none; }
body.small.mpanels #wDivs { display: block; top: calc(var(--tb, 46px) + 6px); left: 8px; right: 8px; width: auto; max-height: 34vh; z-index: 8; }
body.small.mpanels #wOrders { display: block; top: calc(var(--tb, 46px) + 34vh + 12px); left: 8px; right: 8px; width: auto; max-height: 20vh; z-index: 8; }
body.small.mpanels #wLog { display: block; left: 8px; right: 8px; top: calc(var(--tb, 46px) + 54vh + 18px); bottom: auto; max-height: 14vh; z-index: 8; }
body.small.mpanels #wInfo { display: none; }
/* 항구 = 아래 절반 판(위 절반에 정박한 모습) */
body.small #port.overlay { left: 0; right: 0; width: auto; top: 46vh; background: none; padding: 0 6px 6px; }
body.small #port .dlg.port { border-radius: 10px 10px 0 0; padding: 10px; }
body.small #port .ph { flex-direction: column; gap: 2px; }
body.small #port .ptab { flex: 1 1 45%; }
body.small #port table.rep { font-size: 11px; }
body.small #port .pmain { overflow-x: auto; }
/* 전투: 배 정보 · 기록 · 세력은 '☰ 판' 으로, 명령 판은 아래 */
body.small #force, body.small #shipPanel, body.small #log { display: none; }
body.small.mpanels #shipPanel { display: block; left: 8px; right: 8px; width: auto; top: calc(var(--tb, 46px) + 4px); bottom: 96px; z-index: 8; }
body.small #cmd { left: 6px; right: 6px; transform: none; bottom: 92px; padding: 4px 6px; }
body.small #cmd .lbl { display: none; }
body.small #cmd input[type=range] { width: 120px; }
body.small #cards { height: 86px; gap: 6px; padding: 6px; overflow-x: auto; }
body.small #cards > * { flex: none; }
body.small #tune { left: 8px; right: 8px; width: auto; top: calc(var(--tb, 46px) + 4px); }
body.small .dlg { width: calc(100% - 16px); padding: 10px; }
body.small #scene-title .t-name { font-size: 40px; }
body.small .card { width: 190px; }
body.small .dlg, body.small #port .dlg.port { box-sizing: border-box; }
body.small #port .pbody nav button { min-width: 0; white-space: normal; }
body.small .t-box { left: 16px; right: 16px; width: auto; max-width: none; }
body.small .t-sub, body.small .t-foot { white-space: normal; }

/* ===== 11-25 전체 화면 단추 · 가로로 든 핸드폰(body.small.land) — 사용자 "전체화면모드로 만들고 가로 화면 모드도 지원" ===== */
#fsBtn { display: none; position: fixed; right: 10px; bottom: 86px; z-index: 40; padding: 8px 12px; font-weight: 700; box-shadow: 0 2px 8px #0008; }
body.small #fsBtn { display: inline-flex; }
body.small[data-scene="title"] #fsBtn { top: 10px; bottom: auto; }
#wTop, #topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
/* 가로: 단추 = 왼쪽 위 */
body.small.land #panelToggle { right: auto; left: max(10px, env(safe-area-inset-left)); top: calc(var(--tb, 46px) + 8px); bottom: auto; }
body.small.land #fsBtn { right: auto; left: calc(max(10px, env(safe-area-inset-left)) + 74px); top: calc(var(--tb, 46px) + 8px); bottom: auto; }
body.small.land[data-scene="title"] #fsBtn { left: auto; right: 10px; top: 10px; }
/* 11-25 타이틀 단추 7개(멀티 둘 더함) — 가로 핸드폰(높이 412)에서 출처 글이 단추를 덮고 설정이 잘렸음 → 단추 두 줄 · 출처 글은 단추 아래 */
body.small.land .t-box { top: 8px; bottom: 0; overflow: auto; gap: 6px; }
body.small.land #scene-title .t-name { font-size: 30px; letter-spacing: 6px; }
body.small.land .t-menu { display: grid; grid-template-columns: 1fr 1fr; width: min(640px, 72vw); gap: 6px; }
body.small.land .t-menu button { font-size: 13px; padding: 6px 8px; min-height: 40px; }
body.small.land .t-foot { position: static; font-size: 9px; max-width: 72vw; }
/* 가로 세계: 정보 = 오른쪽 세로 칸 · 목록 = 왼쪽 칸 */
body.small.land #wInfo { top: calc(var(--tb, 46px) + 4px); right: max(8px, env(safe-area-inset-right)); left: auto; bottom: 8px; width: min(300px, 38vw); max-height: none; }
body.small.land.mpanels #wInfo { display: block; }
body.small.land.mpanels #wDivs { top: calc(var(--tb, 46px) + 50px); left: max(8px, env(safe-area-inset-left)); right: auto; width: min(300px, 38vw); max-height: calc(60vh - var(--tb, 46px) - 50px); }
body.small.land.mpanels #wOrders { top: calc(60vh + 4px); left: max(8px, env(safe-area-inset-left)); right: auto; width: min(300px, 38vw); max-height: calc(40vh - 12px); }
body.small.land.mpanels #wLog { display: none; }
/* 가로 항구: 오른쪽 절반 판 */
body.small.land #port.overlay { top: 0; left: auto; right: 0; width: 56vw; padding: 6px 6px 6px 16px; background: linear-gradient(90deg, rgba(5,10,14,0) 0, rgba(5,10,14,0.55) 16px); }
body.small.land #port .dlg.port { border-radius: 10px; }
/* 가로 전투: 카드 줄은 '☰ 판' 으로 · 명령 판 = 맨 아래 · 배 정보 = 오른쪽 칸 */
body.small.land #cards { display: none; }
body.small.land.mpanels #cards { display: flex; bottom: 0; z-index: 8; }
body.small.land #cmd { bottom: 6px; left: 50%; right: auto; transform: translateX(-50%); max-width: 70vw; }
body.small.land #cmd .r { flex-wrap: nowrap; }
body.small.land.mpanels #shipPanel { left: auto; right: max(8px, env(safe-area-inset-right)); width: min(330px, 42vw); top: calc(var(--tb, 46px) + 4px); bottom: 96px; }

/* ===== 11-25 03:3x UI 점검(사용자 "PC, 모바일 버전쪽 UI 개선도 빼먹지 말고 한번씩은 점검하셈") — tests/ui_audit.js 그림으로 찾음 =====
   ① 핸드폰 위 띠: 옆으로 밀어야 보이던 단추 6개(3D/전략 · 무역풍 · 무역로 · 피드백 · 메뉴 · 도움말) → 줄바꿈으로 다 보이게. 아래 판 · 단추는 --tb(위 띠 실제 높이, scenes.js 가 잼)를 따라감
   ② 핸드폰 누름 칸 29 px → 36 px(위 띠) · 38 px(로비 입력 · 단추)
   ③ 세로 세계 화면: 아래 정보 판이 오른쪽 '판' · 전체 화면 단추 밑에 깔림 → 판을 단추 기둥만큼 비킴 */
body.small #wTop, body.small #topbar { flex-wrap: wrap; height: auto; overflow: visible; padding-top: 4px; padding-bottom: 4px; row-gap: 4px; }
body.small #wTop button, body.small #topbar button { min-height: 36px; }
body.small #scene-lobby input, body.small #scene-lobby button { min-height: 38px; }
body.small:not(.land)[data-scene="world"] #wInfo { right: 84px; }
body.small #wInfo button, body.small .dlg button, body.small #port button { min-height: 36px; }
/* 11-25 배정 창 핸드폰 그림(media/2026-11-25/assign_phone.png)에서 보인 하자:
   ① 전체 화면 · '판' 단추(z-index 40)가 배정 · 보고서 · 도움말 · 게임 메뉴 창 위에 떠서 명부를 가림 → 창들을 그 위로(피드백 창 80 은 맨 위 그대로)
   ② 세로 핸드폰에서 '슬롯 | 명부(380px)' 두 칸이 화면보다 넓어 명부가 오른쪽으로 잘림 → 좁은 화면은 한 칸(슬롯 위 · 명부 아래) */
#assign, #result { z-index: 45; } #help { z-index: 46; } #gameMenu { z-index: 47; }
@media (max-width: 700px) { .as-wrap { grid-template-columns: 1fr; } .roster { max-height: none; } }
/* ↑ z-index 만으론 안 됐음(11-25 다시 찍은 그림): 창들은 #app(position: fixed = 따로 쌓임 묶음) 안이라 body 바로 아래 #fsBtn · #panelToggle(40)을 못 넘음 → 창이 떠 있는 동안 떠 있는 단추를 숨김 */
body:has(#assign:not(.hidden), #result:not(.hidden), #help:not(.hidden), #gameMenu:not(.hidden), #fbDlg:not(.hidden), #port:not(.hidden)) :is(#fsBtn, #panelToggle) { display: none !important; }
#shipPanel .row .lab { white-space: nowrap; } /* 11-25 그림: "Stern chaser 2문" 이 두 줄로 꺾였음 */
/* 11-25 '임시 · 의견' 단추(디디님 확인 거리 → 피드백 창 그 주제) */
.askq { font-size: 11px; padding: 2px 6px; margin-left: 4px; vertical-align: middle; background: #2b2a18; border-color: #8a7a3a; }
.askq .tmp { font-size: 10px; }
body.small .askq { min-height: 32px; }
.fbq { margin: 4px 0 2px; }
/* 11-25 12시 핸드폰 세로 전투 화면 UI 점검(tests/ui_audit.js 장면 battle · battle_en 을 처음 넣고 찾음 — 옮기기 전부터 있던 버그):
   ① 배속 단추 ×8 · ×16 이 오른쪽 화면 밖(#timeCtl 묶음이 412 px 보다 넓은데 줄바꿈 없음) → 묶음 안도 줄바꿈
   ② 명령 판 단추 · 키 슬라이더 높이 29 · 16 px(누르기 작음) → 36 px
   ③ 오른쪽 아래 떠 있는 전체 화면 · '판' 단추가 '발포' 단추와 적 카드를 가림 → 세로 전투에선 위 띠 바로 아래 오른쪽으로
   ④ 카드 글이 두 줄로 꺾여 'Hull 최저' 줄이 카드 밖으로 잘림 → 한 줄 · 넘치면 … */
body.small #timeCtl, body.small #menuCtl { flex-wrap: wrap; row-gap: 4px; flex: 0 1 auto; max-width: 100%; }
body.small #cmd .r { flex-wrap: wrap; }
body.small #cmd button, body.small #port table.rep button { min-height: 36px; white-space: nowrap; }
body.small #cmd input[type=range] { height: 32px; }
body.small:not(.land)[data-scene="battle"] #panelToggle { top: calc(var(--tb, 46px) + 8px); bottom: auto; }
body.small:not(.land)[data-scene="battle"] #fsBtn { top: calc(var(--tb, 46px) + 8px); bottom: auto; right: 84px; }
body.small .card .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.small .card .fl0 { display: none; } /* ④ 덧붙임: 아무 일 없음 줄은 작은 화면 카드(86 px)에서 숨김 — 일이 생기면(함장 불능 등) 보임 */

/* 11-26 인벤토리 칸막이(port_ui.js marketGrid) */
.inv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 8px 0; }
.ibox { background: #14212b; border: 1px solid #22323e; border-radius: 8px; padding: 8px; }
.ibox.wide { grid-column: 1 / -1; }
.ihead { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.igrid.mk { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.icell { position: relative; min-height: 52px; background: #0d161d; border: 1px solid #2b3d4b; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; cursor: grab; }
.icell.empty { border-style: dashed; opacity: .45; cursor: default; }
.icell.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.icell .iq { position: absolute; right: 4px; bottom: 2px; font-size: 12px; font-weight: 700; text-shadow: 0 0 3px #000; }
.icell .ifill { position: absolute; left: 0; bottom: 0; width: 3px; background: var(--accent); }
.icell.mkc { flex-direction: column; padding: 6px 4px; min-height: 86px; gap: 2px; }
.mkn { font-size: 13px; text-align: center; }
.mkp { font-size: 12px; opacity: .9; }
.gico { pointer-events: none; }
.iact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #101b24; border: 1px solid #22323e; border-radius: 8px; padding: 8px; position: sticky; bottom: 0; }
.iact button { min-height: 40px; }
.ighost { position: fixed; z-index: 9999; pointer-events: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: #0d161dcc; border: 1px solid var(--accent); border-radius: 6px; }
.ighost .iq { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; }
@media (max-width: 700px), (max-height: 520px) { /* 11-26 핸드폰: 행동 판이 칸을 덮지 않게 · 칸 조금 작게 */
  .iact { position: static; }
  .igrid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
  .icell { min-height: 44px; }
  .igrid.mk { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .icell.mkc { min-height: 74px; }
}
body.small:not(.land) #port.overlay.tall { top: 16vh; } /* 11-26: 핸드폰 세로 — 시장 · 창고 칸 화면일 때만 항구 창을 위로 늘림(평소엔 위에 3D 배가 보이게 46vh) */
/* 11-27 모바일 컴팩트 UI 최적화 (사용자 "모바일 UI가 너무 크고 한 화면에 너무 많음") */
body.small { font-size: 11px; }
body.small button { padding: 3px 6px; font-size: 11px; }
body.small button.big { padding: 5px 8px; font-size: 11.5px; }
body.small #wTop, body.small #topbar { padding: 2px 6px; gap: 3px; row-gap: 3px; font-size: 10.5px; }
body.small #wTop button, body.small #topbar button { min-height: 32px; min-width: 32px; padding: 2px 6px; font-size: 10.5px; }
body.small #wInfo button, body.small .dlg button, body.small #port button, body.small #cmd button, body.small #port table.rep button { min-height: 32px; min-width: 32px; }
body.small #panelToggle, body.small #fsBtn { padding: 4px 8px; font-size: 11px; min-height: 32px; min-width: 32px; }
/* 모바일 전투: 하단 카드 줄은 기본 숨김(☰ 판으로 열기) → 바다 시야 확보, 명령 판을 맨 아래로 컴팩트하게 */
body.small[data-scene="battle"] #cards { display: none; }
body.small.mpanels[data-scene="battle"] #cards { display: flex; bottom: 0; height: 74px; padding: 4px; z-index: 9; }
body.small[data-scene="battle"] #cmd { bottom: 6px; padding: 3px 5px; gap: 3px; max-width: calc(100vw - 12px); }
body.small[data-scene="battle"] #cmd .r { gap: 3px; }
body.small[data-scene="battle"] #cmd .hint { display: none; }
body.small[data-scene="battle"] #cmd input[type=range] { width: 92px; height: 32px; }
body.small.mpanels[data-scene="battle"] #cmd { bottom: 78px; }
body.small.land[data-scene="battle"] #cmd { max-width: 66vw; }
/* 모바일 세계/항구: 정보 칸 슬림화 + 항구 탭은 가로 한 줄 스크롤(높이 자동 슬림) */
body.small #wInfo { max-height: 22vh; padding: 5px 8px; font-size: 11px; }
body.small.land #wInfo { width: min(240px, 30vw); }
body.small.land #port.overlay { width: 50vw; }
body.small #port .pbody { flex-direction: column; }
body.small #port .pbody nav { flex-direction: row; flex-wrap: nowrap; align-items: center; flex: 0 0 auto; width: 100%; height: auto; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
body.small #port .pbody nav > div { display: none; }
body.small #port .pbody nav button, body.small #port .ptab { flex: none; white-space: nowrap; height: auto; padding: 4px 8px; }
body.small #port .dlg.port { padding: 8px; }
body.small #port table.rep { font-size: 10.5px; }
body.small #port select { font-size: 11px; padding: 3px 4px; max-width: 100%; }
/* 11-26 배정 화면 부상 표지(디디님 피드백) */
.tag.inj { border-color: #c0504d; color: #ff9b97; }

/* ===== 11-28 19세기 해군성 3종 UI 테마 (hybrid=C 기본 · navy=A 다크 해군성 황동 · parchment=B 양피지 해도) + 커스텀 그래픽 ===== */
.ship-sil, .gun-ico { vertical-align: middle; margin-right: 4px; flex: none; }
.wood-chip { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.35); vertical-align: middle; margin-right: 4px; }

/* 공통 황동 해군성 다크 베이스 (hybrid · navy) */
body[data-theme="hybrid"], body[data-theme="navy"] {
  --bg: #0a141f;
  --panel: rgba(11, 22, 34, 0.90);
  --line: rgba(197, 160, 89, 0.42);
  --text: #f0eadc;
  --muted: #b5aa94;
  --accent: #e0b86b;
}
body[data-theme="hybrid"] .panel, body[data-theme="navy"] .panel,
body[data-theme="hybrid"] #topbar, body[data-theme="navy"] #topbar,
body[data-theme="hybrid"] #wTop, body[data-theme="navy"] #wTop,
body[data-theme="hybrid"] #cmd, body[data-theme="navy"] #cmd {
  background: linear-gradient(180deg, rgba(16, 30, 46, 0.93), rgba(9, 19, 30, 0.94));
  border-color: rgba(197, 160, 89, 0.46);
  box-shadow: inset 0 1px 0 rgba(235, 200, 125, 0.16), 0 4px 16px rgba(0, 0, 0, 0.45);
}
body[data-theme="hybrid"] button, body[data-theme="navy"] button {
  background: linear-gradient(180deg, #1b2f44, #122233);
  border-color: rgba(197, 160, 89, 0.45);
  color: #f0eadc;
}
body[data-theme="hybrid"] button:hover, body[data-theme="navy"] button:hover {
  border-color: #e0b86b;
  background: linear-gradient(180deg, #243e59, #182d42);
}
body[data-theme="hybrid"] button.on, body[data-theme="navy"] button.on,
body[data-theme="hybrid"] button.big, body[data-theme="navy"] button.big {
  background: linear-gradient(180deg, #3b4f68, #24374d);
  border-color: #e0b86b;
  color: #fff6e0;
}
body[data-theme="hybrid"] h2, body[data-theme="hybrid"] h3,
body[data-theme="navy"] h2, body[data-theme="navy"] h3 {
  font-family: Georgia, "Times New Roman", "Malgun Gothic", serif;
  color: #ebd096;
  letter-spacing: 0.3px;
}

/* 양피지 해도 테마 — B(parchment)는 전체 창·HUD, C(hybrid)는 항구·보고서·배정·메뉴·도움말 창만 */
body[data-theme="navy"] #port .dlg.port {
  background: linear-gradient(180deg, rgba(16, 29, 43, 0.97), rgba(10, 20, 31, 0.98));
  color: #f0eadc;
  border: 1.5px solid rgba(197, 160, 89, 0.6);
}
body[data-theme="parchment"],
body[data-theme="hybrid"] .dlg {
  --text: #261b12;
  --dim: #5d4a35;
  --line: #a98b5b;
  --accent: #8c2a24;
  --panel: rgba(243, 232, 207, 0.96);
  --panel2: rgba(235, 221, 189, 0.97);
}
body[data-theme="parchment"] .panel,
body[data-theme="parchment"] #topbar, body[data-theme="parchment"] #wTop,
body[data-theme="parchment"] #cmd, body[data-theme="parchment"] .card,
body[data-theme="parchment"] .dlg, body[data-theme="parchment"] #port .dlg.port,
body[data-theme="hybrid"] .dlg, body[data-theme="hybrid"] #port .dlg.port {
  background: linear-gradient(180deg, #f3e8cf, #e5d5b2);
  color: #261b12;
  border: 1.5px solid #8a6b3e;
  box-shadow: inset 0 0 24px rgba(138, 107, 62, 0.18), 0 6px 22px rgba(0, 0, 0, 0.45);
}
body[data-theme="parchment"] .note, body[data-theme="hybrid"] .dlg .note { color: #5d4a35; }
body[data-theme="parchment"] h2, body[data-theme="parchment"] h3,
body[data-theme="hybrid"] .dlg h2, body[data-theme="hybrid"] .dlg h3 {
  font-family: Georgia, "Times New Roman", "Malgun Gothic", serif;
  color: #4a2318;
  border-bottom: 1px solid rgba(138, 107, 62, 0.35);
  padding-bottom: 3px;
}
body[data-theme="parchment"] button, body[data-theme="hybrid"] .dlg button {
  background: linear-gradient(180deg, #e7d8b8, #d5c097);
  border-color: #8a6b3e;
  color: #261b12;
}
body[data-theme="parchment"] button:hover, body[data-theme="hybrid"] .dlg button:hover {
  background: linear-gradient(180deg, #f0e3c6, #dec9a0);
  border-color: #5c3a1a;
}
body[data-theme="parchment"] button.on, body[data-theme="parchment"] button.big,
body[data-theme="hybrid"] .dlg button.on, body[data-theme="hybrid"] .dlg button.big,
body[data-theme="hybrid"] .dlg .ptab.on {
  background: linear-gradient(180deg, #8c2a24, #6b1d19);
  border-color: #c5a059;
  color: #fdf6e4;
}
body[data-theme="parchment"] select, body[data-theme="parchment"] input,
body[data-theme="hybrid"] .dlg select, body[data-theme="hybrid"] .dlg input {
  background: #faf3e3;
  color: #261b12;
  border: 1px solid #8a6b3e;
}
body[data-theme="parchment"] .ibox, body[data-theme="parchment"] .scard, body[data-theme="parchment"] .pool, body[data-theme="parchment"] .ord, body[data-theme="parchment"] .pmsg,
body[data-theme="parchment"] .slot, body[data-theme="parchment"] .person, body[data-theme="parchment"] .healbox, body[data-theme="parchment"] .mast,
body[data-theme="hybrid"] .dlg .ibox, body[data-theme="hybrid"] .dlg .scard, body[data-theme="hybrid"] .dlg .pool, body[data-theme="hybrid"] .dlg .ord, body[data-theme="hybrid"] .dlg .pmsg,
body[data-theme="hybrid"] .dlg .slot, body[data-theme="hybrid"] .dlg .person, body[data-theme="hybrid"] .dlg .healbox, body[data-theme="hybrid"] .dlg .mast {
  background: rgba(255, 250, 238, 0.76);
  border-color: #a98b5b;
  color: #261b12;
}
body[data-theme="parchment"] .slot.cur, body[data-theme="hybrid"] .dlg .slot.cur {
  background: #fff9e6;
  border-color: #8c2a24;
  box-shadow: 0 0 0 1.5px #8c2a24 inset;
}
body[data-theme="parchment"] .slot.swapok, body[data-theme="hybrid"] .dlg .slot.swapok { background: #e3f2e3; border-color: #2d7a42; }
body[data-theme="parchment"] .slot.dragover, body[data-theme="hybrid"] .dlg .slot.dragover { background: #f8ecc2; border-color: #9c6a14; }
body[data-theme="parchment"] .swapbar, body[data-theme="hybrid"] .dlg .swapbar { background: #f6e7c1; border-color: #9c6a14; color: #362516; }
body[data-theme="parchment"] .kbd, body[data-theme="hybrid"] .dlg .kbd { background: #ede0c4; border-color: #8a6b3e; color: #261b12; }
body[data-theme="parchment"] .icell, body[data-theme="hybrid"] .dlg .icell {
  background: #f5ebd4;
  border-color: #a98b5b;
  color: #261b12;
}
body[data-theme="parchment"] .iact, body[data-theme="hybrid"] .dlg .iact {
  background: #e5d4b0;
  border-color: #8a6b3e;
}
body[data-theme="parchment"] table.rep th, body[data-theme="parchment"] table.rep td,
body[data-theme="hybrid"] .dlg table.rep th, body[data-theme="hybrid"] .dlg table.rep td {
  border-color: rgba(138, 107, 62, 0.35);
}
body[data-theme="parchment"] .good, body[data-theme="hybrid"] .dlg .good { color: #1f6b36; font-weight: 600; }
body[data-theme="parchment"] .bad, body[data-theme="hybrid"] .dlg .bad { color: #9c221b; font-weight: 600; }
body[data-theme="parchment"] .tag, body[data-theme="hybrid"] .dlg .tag {
  background: rgba(138, 107, 62, 0.18);
  border-color: #8a6b3e;
  color: #362516;
}
body[data-theme="parchment"] .tag.rar-uncommon, body[data-theme="hybrid"] .dlg .tag.rar-uncommon { color: #1b6428; border-color: #2f7a3d; }
body[data-theme="parchment"] .tag.rar-rare, body[data-theme="hybrid"] .dlg .tag.rar-rare { color: #174c85; border-color: #2a66a3; }
body[data-theme="parchment"] .tag.rar-epic, body[data-theme="hybrid"] .dlg .tag.rar-epic { color: #6b248a; border-color: #853aa8; }
body[data-theme="parchment"] .tag.trait, body[data-theme="hybrid"] .dlg .tag.trait { color: #6e4610; border-color: #9e7432; }
body[data-theme="parchment"] .tag.skill, body[data-theme="hybrid"] .dlg .tag.skill { color: #5c3a06; border-color: #9c7222; background: rgba(197, 160, 89, 0.25); }
.tag.inj-serious { background: #4a1c1c; } .tag.inj-critical { background: #6b1010; color: #fff; }
.slot.hurt { border-color: #c0504d !important; box-shadow: 0 0 0 1px #c0504d inset; }
.hpn { font-size: 10px; opacity: .75; font-weight: 400; } /* 11-26 체력 수치(디디님) */
/* 11-26 카드 표지(PLAN 5-9 임시) */
.tag.rar { font-size: 10px; } .tag.rar-uncommon { color: #8fe08f; border-color: #3f7a3f; } .tag.rar-rare { color: #7fc2ff; border-color: #2f5f8f; } .tag.rar-epic { color: #e0a8ff; border-color: #7a3f9a; }
.tag.trait { font-size: 10px; color: #f2d28a; border-color: #6b5a2a; margin-left: 3px; } .tag.skill { font-size: 10px; color: #ffd76b; border-color: #8a6a1a; background: #2a2210; margin-left: 3px; }
.ctags { margin-top: 2px; line-height: 1.6; }
.scards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin: 8px 0; } .scard { background: #14212b; border: 1px solid #22323e; border-radius: 8px; padding: 8px; } .srow { font-size: 12px; margin: 2px 0 6px; }

/* 11-28 항구 칸 좁은 화면 글 깨짐(사용자 09:53 "조선소 · 인력 모집소 … 몇몇 ui가 작아서 글씨 배열이나 줄이 깨지는 현상") — 시험 tests/port_tabs_cdp.js */
#port .pmain { word-break: keep-all; overflow-wrap: break-word; }        /* 한국어 낱말을 음절 단위로 쪼개지 않음 */
#port .pmain button { white-space: nowrap; }
#port table.rep td:has(> .bar.inl) { white-space: nowrap; }
.pools { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }  /* 옛 4칸 고정 → 폭 따라 4 · 2 · 1칸 */
.pool button { display: block; width: 100%; }
.row.top { align-items: flex-start; }
.upgs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.upgs button { display: flex; align-items: center; justify-content: flex-start; gap: 4px; padding: 4px 6px; }
.upgs button svg { flex: none; }
body.small #port select { min-height: 32px; }
body.small #port .row { flex-wrap: wrap; }
body.small #port .row .lab { width: auto; flex: 1 0 100%; }
body.small #port .row select { flex: 1 1 100%; }
/* 핸드폰 = 표를 줄마다 카드로 쌓음(머리 글은 칸 앞에 작게 — port_ui.js 가 data-l 로 붙임) */
body.small #port table.rep, body.small #port table.rep tbody { display: block; width: 100%; }
body.small #port table.rep tr:has(> th) { display: none; }
body.small #port table.rep tr { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 0 0 8px; }
body.small #port table.rep td { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; border: 0; padding: 2px 0; font-size: 12px; }
body.small #port table.rep td[data-l]::before { content: attr(data-l); color: var(--dim); flex: 0 0 72px; font-size: 11px; }
body.small #port table.rep td:empty { display: none; }
#port .pool button, body.small #port table.rep td button { white-space: normal; }   /* 긴 단추 글(추천서 1장으로 등)은 낱말 단위로 접힘 — nowrap 이면 단추 밖으로 나감 */
body.small #port table.rep td[data-l]::before { flex-basis: 92px; }
body.small #port .row .lab { flex: 0 0 auto; min-width: 72px; }                 /* 고르기 상자 없는 줄 = 이름 · 값 한 줄 */
body.small #port .row:has(select) .lab { flex: 1 0 100%; }
body.small #port .pbody nav { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); } /* 칸 이름 줄이 옆으로 더 있음을 보임 */

/* ===== 11-29 글자 명암비 고침(사용자 "ui 글자 색깔 검토좀" — 돛 띠 · 피드백 글 칸이 안 읽힘) — 시험 E:/LineShip_tmp/contrast/audit.js(WCAG 4.5 : 1 · 큰 글 3 : 1) =====
   원인 = 양피지 테마(parchment · hybrid 의 .dlg)가 --text · --dim 을 어둡게 바꾸는데, ① 바탕을 어둡게 박아 둔 HUD 칸(돛 띠 · 날씨 칸 · 폭풍 칸 · 풍선 도움말)은 글 색을 물려받아 어두운 글 + 어두운 바탕이 됨
   ② 상태 색 변수(--player · --enemy · --warn · --ok · --buff · --debuff · --light · --serious · --critical)는 어두운 바탕용 밝은 색 그대로라 양피지 위에서 안 읽힘 ③ 글 입력 칸(textarea)은 바탕을 인라인으로 박아 둠 */

/* ① 늘 어두운 HUD 칸 = 자기 글 색 · 밝은 상태 색을 스스로 가짐(어느 테마든) */
#wxSail, #wxBox, #stormBox, #tip {
  color: #e9eef2;
  --text: #e9eef2; --dim: #a9bcc7; --accent: #7fd4ff;
  --player: #9fd2ff; --enemy: #ffb1a3; --warn: #f2c14e; --ok: #6fd58b; --buff: #6fd58b; --debuff: #ff7b6b;
  --light: #f2c14e; --serious: #ff9b55; --critical: #ff5a5a;
}
body[data-theme="hybrid"] #tip, body[data-theme="navy"] #tip { --accent: #e0b86b; }

/* ② 양피지 바탕 위 상태 색 = 같은 색상 계열의 짙은 판 */
body[data-theme="parchment"], body[data-theme="hybrid"] .dlg {
  --player: #1b5a92; --enemy: #a3301f; --warn: #865300; --ok: #1f6b36; --buff: #1f6b36; --debuff: #a8291c;
  --light: #7a5800; --serious: #9e4608; --critical: #a3161a;
}
/* 11-29 20:3x 전체 검사: 질문 단추(.askq) 바탕(222,204,168)이 양피지보다 어두워 '임시' 꼬리표 10px 가 4.09 → 꼬리표만 더 짙게(약 5.3) */
body[data-theme="parchment"] .tmp, body[data-theme="hybrid"] .dlg .tmp { color: #6e4400; border-color: #6e4400; }
/* 양피지 테마에서 어두운 바탕을 박아 둔 작은 칸들 → 양피지 판 */
body[data-theme="parchment"] .chip, body[data-theme="hybrid"] .dlg .chip { background: rgba(255, 250, 238, 0.8); }
body[data-theme="parchment"] .chip .n, body[data-theme="hybrid"] .dlg .chip .n { background: rgba(38, 27, 18, 0.12); color: #261b12; }
body[data-theme="parchment"] .chip.buff .n, body[data-theme="hybrid"] .dlg .chip.buff .n { background: var(--buff); color: #fff; }
body[data-theme="parchment"] .chip.debuff .n, body[data-theme="hybrid"] .dlg .chip.debuff .n { background: var(--debuff); color: #fff; }
body[data-theme="parchment"] .divrow.cur, body[data-theme="hybrid"] .dlg .divrow.cur { background: #fff4d6; }
body[data-theme="parchment"] .tag.inj-serious, body[data-theme="hybrid"] .dlg .tag.inj-serious { background: #f3d6d2; color: #8a1d14; }
body[data-theme="parchment"] .tag.inj-critical, body[data-theme="hybrid"] .dlg .tag.inj-critical { background: #8a1d14; color: #fff; }
body[data-theme="parchment"] .tag.inj, body[data-theme="hybrid"] .dlg .tag.inj { color: #8a1d14; }

/* ③ 글 입력 칸 · 안내 글(placeholder) = 테마 따라 */
textarea { background: #0e1a22; color: var(--text); border: 1px solid #36546a; border-radius: 6px; }
::placeholder { color: var(--dim); opacity: 1; }
body[data-theme="parchment"] textarea, body[data-theme="hybrid"] .dlg textarea { background: #faf3e3; color: #261b12; border: 1px solid #8a6b3e; }

/* ④ 세계 아래 안내 줄(#wHint)도 늘 어두운 띠 → ①과 같은 자기 글 색 */
#wHint { color: #e9eef2; --text: #e9eef2; --dim: #a9bcc7; }

/* ⑤ 흐리게 한 '꺼짐' 표시 = 3 : 1 은 남게(옛 opacity .35 · .45 → 글이 바탕에 묻힘) — 흐림 대신 회색조를 같이 써서 꺼짐은 그대로 보이게 */
.person.no { opacity: 0.75; filter: grayscale(0.7); }
.slot.swapno { opacity: 0.75; filter: grayscale(0.7); }
.ptab.off { opacity: 0.75; filter: grayscale(0.7); }
body[data-theme="parchment"] button:disabled, body[data-theme="hybrid"] .dlg button:disabled {
  opacity: 1; background: #d9ccb0; border-color: #a98b5b; color: #5e4d38;
}
body[data-theme="parchment"] button:disabled .kbd, body[data-theme="hybrid"] .dlg button:disabled .kbd { color: #5e4d38; }

/* ⑥ 작은 체력 수치(.hpn) = 흐림 대신 --dim 색 */
.hpn { opacity: 1; color: var(--dim); }

/* ⑦ 나라 이름 글(항구 머리 — 나라 색은 지도용이라 어두운 바탕 · 양피지 바탕 둘 다에 맞게 섞음) */
.natn { color: color-mix(in srgb, var(--nc) 60%, #fff); }
body[data-theme="parchment"] .natn, body[data-theme="hybrid"] .dlg .natn { color: color-mix(in srgb, var(--nc) 50%, #000); }

/* ⑧ 고르기 상자(select) · 글 칸 = 어두운 테마에서도 글 색을 테마 글 색으로(브라우저 기본 = 검정) */
/* :where() = 세기 0 — 테마 · 칸마다 따로 정한 규칙(양피지 창 안 입력 칸 · 로비 입력 칸)이 늘 이김, 브라우저 기본보다만 앞섬 */
:where(body:not([data-theme="parchment"])) :where(select, input:not([type=checkbox], [type=radio], [type=range], [type=color])) { background: #0e1a22; color: var(--text); border: 1px solid #36546a; border-radius: 4px; }
#scene-lobby input::placeholder { color: #9fb3bf; }   /* 로비 입력 칸은 어느 테마든 어두운 칸(위 #scene-lobby input) */
body.small #wInfo .note.wxtip { display: none; }      /* 옛 '.note[style]' 숨김을 이어받음(인라인 opacity 를 뺐으므로) */

/* 11-30 디디님 피드백: 세계 지도 적대 함대 발견 알람(world_ui.js spotCheck — 3초 뒤 저절로 사라짐) */
#spotAlarm { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 60; pointer-events: none; max-width: min(92vw, 640px);
  padding: 14px 22px; border-radius: 10px; border: 2px solid #ff8f7a; background: rgba(40, 10, 8, 0.88); color: #ffe2d8;
  font-size: 18px; font-weight: 700; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.5); animation: spotIn .25s ease-out; }
#spotAlarm .sub { font-size: 13px; font-weight: 400; opacity: .85; margin-top: 4px; }
#spotAlarm svg { width: 20px; height: 20px; vertical-align: -3px; }
@keyframes spotIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 11-30 빠른 소리 창(sound_ui.js) — 전투 #bMusic · 세계 #wSnd 위 띠 단추에서 열고, 타이틀은 왼쪽 아래 둥근 단추. 사용자 '설정에서 굳이굳이 들어가서 바꿔야하는것도 불편하고' */
#sndBtn { position: fixed; left: 10px; top: 10px; z-index: 45; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(12,22,34,.82); border: 1px solid rgba(201,181,147,.55); color: #f1e4c4; box-shadow: 0 2px 8px rgba(0,0,0,.45); cursor: pointer; }
#sndBtn.hidden { display: none; }
#sndBtn svg { width: 20px; height: 20px; }
#sndBtn.off { color: #ff9a8a; border-color: rgba(255,154,138,.7); }
#sndPop { position: fixed; z-index: 85; width: min(300px, calc(100vw - 24px)); padding: 10px 12px; border-radius: 10px; background: rgba(12,22,34,.95); border: 1px solid rgba(201,181,147,.55); color: #f1e4c4; box-shadow: 0 6px 20px rgba(0,0,0,.5); font-size: 13px; }
#sndPop.hidden { display: none; }
#sndPop .sndRow { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#sndPop .sndRow span { width: 84px; flex: none; display: flex; align-items: center; gap: 4px; }
#sndPop .sndRow input[type=range] { flex: 1; min-height: 28px; }
#sndPop .sndRow b { width: 40px; text-align: right; font-weight: 600; }
#sndPop svg { width: 16px; height: 16px; vertical-align: -3px; }
#sndPop .sndNote { opacity: .7; font-size: 11px; margin-top: 4px; }
/* 11-30 UI 끄고 켜기(ui_hide.js · U 키 · 눈 단추) — 사용자 "ui를 키고 끄는 기능도 추가해서 비교해보셈" */
body.noui #topbar, body.noui #force, body.noui #shipPanel, body.noui #log, body.noui #cmd, body.noui #cards, body.noui #view,
body.noui #scene-world > *:not(canvas), body.noui #panelToggle, body.noui #fsBtn, body.noui #sndBtn, body.noui #sndPop, body.noui #spotAlarm, body.noui .wxbox, body.noui #wxSail, body.noui #stormBox, body.noui #tip { visibility: hidden !important; }
#uiEye { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 19; /* 11-30 17:4x 덮는 창(.overlay 20) 아래로 — 핸드폰 리스폰 창의 '리스폰' 버튼을 덮었음(46 이었음) */ width: 34px; height: 34px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(12,22,34,.7); border: 1px solid rgba(201,181,147,.5); color: #f1e4c4; opacity: .75; cursor: pointer; }
body:has(.overlay:not(.hidden)) #uiEye { visibility: hidden; } /* 11-30 17:2x 덮는 창은 #scene-world 안에 있어 z-index 로는 못 가림(따로 쌓임) → 창이 열려 있는 동안 눈 버튼을 숨김 */
#uiEye.on { background: rgba(12,22,34,.9); color: #ffd27a; border-color: #ffd27a; opacity: 1; }
#uiEye svg { width: 18px; height: 18px; }
/* 11-30 핸드폰 UI 크기(사용자 "ui가 너무 큼 … 게임을 조작하는것보다 게임을 보는게 더 힘들어서") — 전투 화면:
   위 띠 · 돛 판 · 명령 판을 줄이고(zoom — 누르는 자리도 같이 줄어듦), 가로 화면에선 돛 판 = 왼쪽 아래 · 명령 판 = 오른쪽 아래로 갈라 가운데(배)를 비움.
   옛 판 = docs/history/2026-11-30/style_before_mobsize.css */
body.small[data-scene="battle"] #topbar { zoom: .78; }
body.small[data-scene="battle"] #cmd { zoom: .78; }
body.small[data-scene="battle"] #wxSail { zoom: .78; }
body.small.land[data-scene="battle"] #topbar { zoom: .72; }
body.small.land[data-scene="battle"] #cmd { zoom: .72; left: auto !important; right: 6px; transform: none !important; bottom: 6px; max-width: calc(58vw / .72); }
body.small.land[data-scene="battle"] #cmd .r { flex-wrap: wrap; justify-content: flex-end; }
body.small.land[data-scene="battle"] #wxSail { zoom: .72; left: 6px !important; transform: none !important; bottom: 6px !important; max-width: calc(38vw / .72); }
body.small.land[data-scene="battle"] #wxSail .lay { justify-content: flex-start; }
/* 11-30 12:2x 사용자 "가로 화면에서 좁은곳은 가로일까? 세로일까?" → 가로 화면은 높이가 좁음: 판을 위아래로 쌓지 않고 옆으로 펼침
   위 띠 = 한 줄(넘치면 옆으로 밀어 봄) · 명령 판 = 줄(명령 · 키 · 돛 % · 발포 태도)을 옆으로 이어 붙임 · 돛 판 = 한 줄 */
body.small.land[data-scene="battle"] #topbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
body.small.land[data-scene="battle"] #topbar > * { flex: none; }
body.small.land[data-scene="battle"] #cmd { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; max-width: calc(60vw / .72); } /* 11-30 64 → 60: 915×412 에서 돛 패널(약 38 %)과 겹쳤음(weather_cdp) */
body.small.land[data-scene="battle"] #cmd .r { flex-wrap: nowrap; }
body.small.land[data-scene="battle"] #wxSail { flex-direction: row; flex-wrap: wrap; align-items: center; }
body.small.land[data-scene="battle"] #wxSail .lay { flex-wrap: nowrap; }
/* 11-30 12:2x 사용자 "반대로 세로화면에서 좁은곳은 세로일까? 가로일까?" → 세로 화면은 폭이 좁음: 옆으로 늘어선 위 띠가 4줄로 접혔음 → 글자를 줄이고 긴 바람 글은 한 줄 말줄임(… — 누르거나 마우스를 올리면 전체는 title)
   판들(돛 · 명령)은 지금처럼 위아래로 쌓음(높이는 넉넉함) */
body.small.port[data-scene="battle"] #topbar { zoom: .7; }
body.small[data-scene="battle"] #windBox { min-width: 0; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.small.land[data-scene="battle"] #windBox { max-width: 30vw; }
/* 11-30 게임 안 업데이트 내역 — 타이틀 왼쪽 위 소리 버튼 옆 · 안 본 새 판 = 빨간 점 */
#clBtn { position: fixed; left: 58px; top: 10px; z-index: 45; height: 40px; padding: 0 14px 0 10px; border-radius: 20px; display: flex; align-items: center; gap: 6px; font-size: 14px; }
#clBtn.hidden { display: none; }
#clBtn .dot, .clDot { display: none; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
#clBtn.new .dot, .clDot { display: inline-block; }
#clDlg .dlg.cl { max-width: 560px; width: calc(100vw - 32px); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
#clDlg .clList { overflow-y: auto; flex: 1; margin: 6px 0 10px; }
#clDlg section { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
#clDlg section.top h3 { color: var(--accent, #e8c46a); }
#clDlg h3 { margin: 4px 0 4px; font-size: 15px; } #clDlg h3 .note { font-weight: 400; margin-left: 6px; }
#clDlg ul { margin: 0; padding-left: 20px; } #clDlg li { margin: 3px 0; line-height: 1.45; }
body.small #clBtn { height: 36px; font-size: 12px; left: 56px; }
body.small.land #sndBtn { left: auto; right: 58px; } body.small.land #clBtn { left: auto; right: 106px; } /* 11-30 가로 = 왼쪽 위가 제목 LINE SHIP 을 덮음(소리 버튼 · 업데이트 내역 둘 다) → 오른쪽 위(전체 화면 버튼 옆)로 */
/* 11-30 저장 슬롯 창(saves.js) · 협동 모드 시계 판(coop.js #coopClk — 세계 시각 · 전투 시각을 따로) */
#saveDlg { z-index: 40; }
#saveDlg .svDlg { max-width: 640px; }
.svTable { width: 100%; }
.svTable td { vertical-align: middle; padding: 6px 6px; }
.svTable .svN { white-space: nowrap; font-weight: bold; }
.svTable .svBtns { white-space: nowrap; text-align: right; }
.svTable tr.cur td { background: rgba(255, 226, 138, 0.08); }
body.small .svTable .svBtns { white-space: normal; }
body.small .svTable .svBtns button { margin: 2px 0; }
#coopClk { position: fixed; top: calc(var(--tb, 46px) + 6px); left: 50%; transform: translateX(-50%); z-index: 15; max-width: min(560px, 92vw); padding: 5px 10px; border-radius: 6px; background: rgba(10, 20, 30, 0.84); border: 1px solid rgba(255, 226, 138, 0.35); font-size: 12px; line-height: 1.45; }
#coopClk .ccBattle { color: #ffb98a; font-weight: bold; }
#coopClk .ccWorld { color: #cfe6ff; }
#coopClk .ccParty { opacity: 0.85; font-size: 11px; }
body.small #coopClk { font-size: 11px; padding: 3px 8px; }
body.small.land #coopClk .ccParty { display: none; }
/* 핸드폰 세로: 위 띠 바로 아래는 바람 · 날씨 글(가운데) · 바람 원판(오른쪽)이 있음 → 그 아래로 내리고 왼쪽에 붙임 */
body.small:not(.land) #coopClk { top: calc(var(--tb, 46px) + 84px); left: 8px; transform: none; max-width: calc(100vw - 16px); }

/* ===== 12-01 모바일(body.small) UI 전면 정리 (mob_ui.js) — PC(body:not(.small)) 무영향 ===== */
#mobCmdBar, #mobDrawerBar, .mob-nav-arr, .mob-port-sz { display: none; }
.mob-nav-wrap { display: contents; }

/* ① 전투 명령 탭/접기 바 (#mobCmdBar) — 하단 시야 확보 */
body.small[data-scene="battle"] #mobCmdBar {
  display: flex; align-items: center; gap: 4px;
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 4px; z-index: 12;
  padding: 3px 5px; border-radius: 999px;
  background: rgba(10, 20, 32, 0.92); border: 1px solid rgba(197, 160, 89, 0.55);
  box-shadow: 0 3px 12px rgba(0,0,0,.5);
  zoom: var(--mob-scale, 1);
}
body.small[data-scene="battle"] #mobCmdBar button { min-height: 28px; padding: 2px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
body.small[data-scene="battle"] #mobCmdBar button.mc-fold { opacity: .85; }
body.small.noui #mobCmdBar, body.small.noui #mobDrawerBar { visibility: hidden !important; }
body:has(.overlay:not(.hidden)) #mobCmdBar, body:has(.overlay:not(.hidden)) #mobDrawerBar { display: none !important; }

/* 전투 명령 판(#cmd) · 돛 판(#wxSail)을 #mobCmdBar 탭 상태에 따라 전환 */
body.small[data-scene="battle"] #cmd { bottom: 42px !important; zoom: calc(0.82 * var(--mob-scale, 1)); }
body.small.land[data-scene="battle"] #cmd { bottom: 40px !important; zoom: calc(0.76 * var(--mob-scale, 1)); }
body.small[data-scene="battle"][data-mob-cmd="fold"] #cmd,
body.small[data-scene="battle"][data-mob-cmd="fold"] #wxSail,
body.small[data-scene="battle"][data-mob-cmd="sail"] #cmd { display: none !important; }
body.small[data-scene="battle"][data-mob-cmd="nav"] #cmd > .r[data-mg="gun"],
body.small[data-scene="battle"][data-mob-cmd="gun"] #cmd > .r[data-mg="nav"] { display: none !important; }
body.small[data-scene="battle"][data-mob-cmd="nav"] #wxSail,
body.small[data-scene="battle"][data-mob-cmd="gun"] #wxSail { display: none !important; }
body.small[data-scene="battle"][data-mob-cmd="sail"] #wxSail {
  display: flex !important; bottom: 42px !important; left: 50% !important; right: auto !important;
  transform: translateX(-50%) !important; max-width: 96vw !important; zoom: calc(0.84 * var(--mob-scale, 1));
}
body.small[data-scene="battle"] #topbar { zoom: calc(0.78 * var(--mob-scale, 1)); }
body.small.land[data-scene="battle"] #topbar { zoom: calc(0.72 * var(--mob-scale, 1)); }

/* ② ☰ 판 드로어 탭 바 + UI 크기 슬라이더 (#mobDrawerBar) */
body.small.mpanels #mobDrawerBar {
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: calc(var(--tb, 46px) + 4px); left: 8px; right: 8px; z-index: 16;
  padding: 6px 8px; border-radius: 8px;
  background: rgba(11, 22, 34, 0.96); border: 1px solid rgba(197, 160, 89, 0.6);
  box-shadow: 0 4px 16px rgba(0,0,0,.55);
}
body.small.mpanels #mobDrawerBar .md-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
body.small.mpanels #mobDrawerBar .md-tabs button { flex: 1 0 auto; min-height: 32px; font-size: 11.5px; white-space: nowrap; }
body.small.mpanels #mobDrawerBar .md-tabs button.md-close { flex: none; min-width: 34px; }
body.small.mpanels #mobDrawerBar .md-scale { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted, #b5aa94); }
body.small.mpanels #mobDrawerBar .md-scale input[type=range] { flex: 1; height: 26px; }
body.small.mpanels #mobDrawerBar .md-scale b { width: 38px; text-align: right; color: var(--accent, #e0b86b); }

/* 세계 화면 ☰ 판: 한 번에 한 탭만 큼직하게 표시 */
body.small.mpanels[data-scene="world"] #wDivs,
body.small.mpanels[data-scene="world"] #wOrders,
body.small.mpanels[data-scene="world"] #wLog {
  display: none !important;
  top: calc(var(--tb, 46px) + 86px) !important; left: 8px !important; right: 8px !important;
  width: auto !important; bottom: 8px !important; max-height: none !important; overflow-y: auto !important; z-index: 15 !important;
}
body.small.mpanels[data-scene="world"][data-mob-wtab="divs"] #wDivs { display: block !important; }
body.small.mpanels[data-scene="world"][data-mob-wtab="orders"] #wOrders { display: block !important; }
body.small.mpanels[data-scene="world"][data-mob-wtab="log"] #wLog { display: block !important; }

/* 전투 화면 ☰ 판: 함선 상태 · 함대 카드 · 전력 비교 · 전투 일지 4탭 전환 */
body.small.mpanels[data-scene="battle"] #shipPanel,
body.small.mpanels[data-scene="battle"] #cards,
body.small.mpanels[data-scene="battle"] #force,
body.small.mpanels[data-scene="battle"] #log {
  display: none !important;
  top: calc(var(--tb, 46px) + 86px) !important; left: 8px !important; right: 8px !important;
  width: auto !important; bottom: 48px !important; max-height: none !important; overflow-y: auto !important; z-index: 15 !important;
}
body.small.mpanels[data-scene="battle"][data-mob-btab="ship"] #shipPanel { display: block !important; }
body.small.mpanels[data-scene="battle"][data-mob-btab="cards"] #cards { display: flex !important; flex-wrap: wrap; align-content: flex-start; height: auto !important; background: rgba(11, 22, 34, 0.94); border: 1px solid rgba(197, 160, 89, 0.45); border-radius: 8px; padding: 8px; }
body.small.mpanels[data-scene="battle"][data-mob-btab="force"] #force { display: grid !important; align-content: start; }
body.small.mpanels[data-scene="battle"][data-mob-btab="log"] #log { display: block !important; }

/* ③ 항구 창(#port) 모바일 탭 슬라이더 ◀/▶ + 높이 확장 토글 */
body.small #port .ph { position: relative; padding-right: 68px; }
body.small #port .mob-port-sz {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; right: 0; top: 0; min-height: 28px; padding: 2px 8px; font-size: 11px;
}
body.small:not(.land) #port.overlay.mob-full { top: 8vh !important; }
body.small #port .mob-nav-wrap { display: flex; align-items: center; gap: 4px; width: 100%; margin-bottom: 4px; }
body.small #port .mob-nav-wrap > nav { flex: 1; min-width: 0; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; mask-image: none; -webkit-mask-image: none; padding-bottom: 0; }
body.small #port .mob-nav-wrap > nav button { scroll-snap-align: center; }
body.small #port .mob-nav-arr { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; min-width: 30px; min-height: 32px; padding: 0; font-size: 12px; }

/* ===== 12-01 뉴비 팁 배너 (#newbieTipBox — tutorial.js) ===== */
#newbieTipBox {
  position: fixed; left: 10px; bottom: 40px; z-index: 14;
  width: min(292px, calc(100vw - 20px));
  padding: 7px 10px; border-radius: 8px;
  background: rgba(11, 22, 34, 0.91); color: #f0eadc;
  border: 1px solid rgba(224, 184, 107, 0.58);
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  font-size: 12px; line-height: 1.45;
}
#newbieTipBox.hidden, body.noui #newbieTipBox, body.mpanels #newbieTipBox,
body:has(#port:not(.hidden), #assign:not(.hidden), #result:not(.hidden), #help:not(.hidden), #gameMenu:not(.hidden)) #newbieTipBox {
  display: none !important;
}
body[data-scene="battle"] #newbieTipBox { bottom: auto; top: calc(var(--tb, 46px) + 8px); left: 10px; }
body.small #newbieTipBox {
  top: calc(var(--tb, 46px) + 6px); bottom: auto; left: 8px; right: auto;
  width: min(310px, calc(100vw - 96px)); font-size: 11px; padding: 5px 8px;
  zoom: var(--mob-scale, 1);
}
#newbieTipBox .nt-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
#newbieTipBox .nt-badge { font-weight: 700; color: #ffd778; font-size: 11.5px; }
#newbieTipBox .nt-acts { display: flex; gap: 4px; }
#newbieTipBox .nt-acts button { min-height: 22px; padding: 1px 6px; font-size: 10.5px; border-radius: 4px; }
#newbieTipBox .nt-body { color: #e9eef2; word-break: keep-all; }

/* ===== 12-01 기함 신호기 바 (#flagSigBar — content_pack3.js) ===== */
#flagSigBar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--tb, 46px) + 6px); z-index: 10;
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(11, 22, 34, 0.88); border: 1px solid rgba(224, 184, 107, 0.5);
  box-shadow: 0 3px 10px rgba(0,0,0,.4); font-size: 11.5px;
}
#flagSigBar.hidden, body.noui #flagSigBar,
body:has(.overlay:not(.hidden)) #flagSigBar { display: none !important; }
#flagSigBar .fs-lbl { color: #ebd096; font-weight: 700; margin-right: 2px; white-space: nowrap; }
#flagSigBar button { min-height: 24px; padding: 2px 7px; font-size: 11px; white-space: nowrap; }
body.small #flagSigBar {
  top: calc(var(--tb, 46px) + 42px); max-width: calc(100vw - 16px); overflow-x: auto;
  zoom: calc(0.84 * var(--mob-scale, 1));
}
body.small.mpanels[data-scene="battle"] #force .f-grid { display: grid; }
/* 12-01 항구 7개 건물 대분류 → 내부 서브탭(.psub, 테마 색 상속) */
#port .psub { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#port .psub-b { font-size: 12px; padding: 4px 10px; border-radius: 6px; }
#port .psub-b.on { font-weight: 700; }
#port .psub-b.off { opacity: 0.48; }

/* 12-01 전 장면 공용 전체 채팅 · 리더보드 · 환생 초기화 UI */
.online-dock{position:fixed;right:326px;top:54px;z-index:940;display:flex;flex-direction:row;gap:6px;pointer-events:auto}
body[data-scene="title"] .online-dock{right:16px;top:16px}
body[data-scene="battle"] .online-dock{right:298px;top:54px}
.on-pill{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;background:rgba(12,21,28,0.86);color:#eaf3f7;border:1px solid rgba(160,210,240,0.35);box-shadow:0 3px 10px rgba(0,0,0,0.35);cursor:pointer;position:relative}
.on-pill:hover{border-color:#9fd2ff}
.on-badge{background:#e04f4f;color:#fff;font-size:10px;line-height:1;padding:2px 5px;border-radius:999px;margin-left:2px}
.on-panel{position:fixed;right:326px;top:92px;width:360px;max-width:calc(100vw - 24px);height:360px;max-height:60vh;z-index:9600;display:flex;flex-direction:column;padding:8px;gap:6px}
body[data-scene="title"] .on-panel{right:16px;top:56px}
#lbPanel,#rebirthDlg{z-index:9600}
.rb-pts{color:#a85500;font-weight:700}
body[data-theme="navy"] .rb-pts{color:#ffe28a}
.on-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border-bottom:1px solid rgba(255,255,255,0.12);padding-bottom:6px;font-size:12px}
.on-tabs{display:flex;gap:4px;margin-left:auto}
.on-tabs button,.on-lbtabs button{padding:3px 8px;font-size:11px;opacity:.75}
.on-tabs button.on,.on-lbtabs button.on{opacity:1;border-color:#ffe28a;color:#ffe28a}
.on-lbtabs{display:flex;gap:6px;margin:8px 0;flex-wrap:wrap}
.on-mini{padding:2px 6px;font-size:11px}
.on-list{flex:1;overflow:auto;display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:1.4;padding-right:4px}
.on-msg{word-break:break-word}
.on-at{opacity:.55;font-size:10px}
.on-nat{display:inline-block;padding:0 4px;border:1px solid;border-radius:3px;font-size:10px;font-weight:700;margin-right:2px}
.on-rb{display:inline-block;color:#ffe28a;font-size:11px;font-weight:700;margin-left:2px}
.on-foot{display:flex;gap:6px}
.on-foot input{flex:1;min-width:0;padding:6px 8px;font-size:12px;border-radius:6px;border:1px solid rgba(255,255,255,0.2);background:rgba(0,0,0,0.35);color:inherit}
.on-me{background:rgba(255,226,138,0.14)}
.rb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;margin:8px 0}
.rb-card{border:1px solid rgba(255,255,255,0.16);border-radius:8px;padding:8px;background:rgba(0,0,0,0.22);font-size:12px}
.rb-card.on{border-color:#ffe28a;background:rgba(255,226,138,0.12)}
.rb-pick{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.rb-pick label{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border:1px solid rgba(255,255,255,0.2);border-radius:6px;font-size:12px;cursor:pointer}
.rb-pick label.sel{border-color:#9fd2ff;background:rgba(159,210,255,0.15)}
