* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  overflow: hidden;
  background: #18181b;
  color: #fafafa;
  font: 14px/1.45 "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

#main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#view {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #18181b;
}

#map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  image-rendering: pixelated;
}
#map.over-port { cursor: pointer; }
#map.dragging { cursor: grabbing; }

#map-tools {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
}

#debug {
  position: absolute;
  top: 52px;
  left: 12px;
  width: 300px;
  padding: 12px;
  background: #27272a;
  border: 1px solid #52525b;
  border-radius: 4px;
}
#debug[hidden] { display: none; }
.debug-group { margin-bottom: 10px; }
.debug-group:last-child { margin-bottom: 0; }
.debug-group > span { display: block; margin-bottom: 4px; color: #d4d4d8; font-size: 12px; }
.debug-group > div { display: flex; flex-wrap: wrap; gap: 4px; }
.debug-group button { height: 28px; padding: 0 8px; font-size: 12px; }

#panel {
  width: 320px;
  flex: none;
  overflow-y: auto;
  background: #27272a;
  border-left: 1px solid #3f3f46;
}

#panel section {
  padding: 16px;
  border-bottom: 1px solid #3f3f46;
}

h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

label {
  display: block;
  margin: 12px 0 4px;
  color: #d4d4d8;
  font-size: 13px;
}
h2 + label { margin-top: 0; }
#load-total { float: right; font-variant-numeric: tabular-nums; }

button {
  height: 32px;
  padding: 0 10px;
  background: #3f3f46;
  border: 1px solid #52525b;
  border-radius: 4px;
  color: #fafafa;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 120ms ease;
}
button:hover:not(:disabled) { background: #52525b; }
button:focus-visible { outline: 2px solid #14b8a6; outline-offset: 1px; }
button:disabled { color: #71717a; background: #303034; border-color: #3f3f46; cursor: not-allowed; }
button.on, button[aria-pressed="true"] { background: #115e59; border-color: #14b8a6; }

select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  background: #3f3f46;
  border: 1px solid #52525b;
  border-radius: 4px;
  color: #fafafa;
  font: inherit;
  font-size: 13px;
}
select:focus-visible { outline: 2px solid #14b8a6; outline-offset: 1px; }

.cargo-row {
  display: grid;
  grid-template-columns: 24px 1fr 32px 40px 32px;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.cargo-row small { display: block; color: #a1a1aa; font-size: 12px; font-variant-numeric: tabular-nums; }
.cargo-row button { padding: 0; }
.cargo-row output { text-align: center; font-variant-numeric: tabular-nums; }

#panel #wallet { padding: 12px 16px; }
#wallet div { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; }
#wallet strong { font-variant-numeric: tabular-nums; }
#wallet strong.gold { font-size: 16px; color: #fbbf24; }
.note { float: right; color: #a1a1aa; font-size: 12px; }
#wait { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#wait button { height: 40px; padding: 0 2px; line-height: 1.2; }
#wait small { display: block; color: #a1a1aa; font-size: 11px; font-variant-numeric: tabular-nums; }
#price-hint { margin: 0 0 6px; color: #a1a1aa; font-size: 12px; }

dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 0;
}
#estimate { margin-top: 12px; }
dt { color: #d4d4d8; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

#plan-error {
  min-height: 20px;
  margin: 8px 0;
  color: #fca5a5;
  font-size: 13px;
}

#sail {
  width: 100%;
  height: 40px;
  background: #115e59;
  border-color: #14b8a6;
  font-size: 14px;
  font-weight: 700;
}
#sail:hover:not(:disabled) { background: #0f766e; }
#sail:disabled { background: #303034; border-color: #3f3f46; }

#run-phase { margin: 0 0 8px; color: #d4d4d8; }

#progress {
  height: 8px;
  margin-bottom: 12px;
  background: #18181b;
  border: 1px solid #3f3f46;
}
#progress-fill { width: 0; height: 100%; background: #14b8a6; }

.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.controls #pause { grid-column: 1 / -1; }

#stock th { position: sticky; top: 0; background: #27272a; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 0; text-align: right; border-bottom: 1px solid #3f3f46; }
th { color: #d4d4d8; font-weight: 400; font-size: 13px; }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border-bottom: 0; }
td.changed { color: #5eead4; font-weight: 700; }
#stock td.stock-goods, #stock th:last-child { text-align: left; padding-left: 16px; }
.stock-goods { color: #a1a1aa; font-size: 12px; }
.stock-goods span { display: inline-block; margin-right: 8px; }
.stock-goods span.changed { color: #5eead4; font-weight: 700; }
#stock td:nth-child(1), #stock th:nth-child(1) { width: 150px; white-space: nowrap; }

#log {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  font-size: 13px;
}
#log li { padding: 2px 0; }
#log li.empty { color: #a1a1aa; }

#wallet .clock { margin-top: 8px; display: grid; grid-template-columns: 1fr; gap: 4px; }
#wallet .clock #play { height: 34px; font-weight: 700; }
#wallet .clock button { padding: 0 2px; }
#wallet .clock #play { grid-column: auto; }
#play.attention { background: #115e59; border-color: #14b8a6; }
.skip-row { margin-top: 6px; color: #d4d4d8; font-size: 13px; }
#skip { display: inline-flex; gap: 4px; }
#skip button { height: 26px; padding: 0 8px; font-size: 12px; }
label.check { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; }
#alert { margin: 8px 0 0; padding: 6px 8px; background: #3f3314; border: 1px solid #854d0e; border-radius: 4px; color: #fde68a; font-size: 13px; }
#money.debt { color: #fca5a5; }
#fleet-bar { flex: none; display: flex; align-items: stretch; gap: 10px; padding: 8px 12px; background: #1f1d1b; border-top: 2px solid #57432f; }
#fleet-bar h2 { flex: none; display: flex; flex-direction: column; justify-content: center; margin: 0; font-size: 14px; white-space: nowrap; }
#fleet-bar h2 .note { float: none; display: block; margin: 2px 0 0; font-size: 11px; }
#fleets { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fleet-item { width: 100%; height: auto; padding: 6px 8px; text-align: left; }
.fleet-item strong { display: block; font-size: 13px; }
.fleet-item small { display: block; color: #a1a1aa; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-item strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#merge, #route-status { margin-top: 8px; }
.roster-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.roster-row > span { flex: 1; font-size: 13px; min-width: 0; }
.roster-row small { display: block; color: #a1a1aa; font-size: 11px; }
.roster-row button, #merge button, #route-status button { height: 26px; padding: 0 6px; font-size: 12px; flex: none; }
#merge { display: flex; flex-wrap: wrap; gap: 4px; }
#merge[hidden], #route-status[hidden] { display: none; }
#route-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #5eead4; }
#route-status span { flex: 1; }
#sail-route { width: 100%; margin-top: 4px; }
.hint { margin: 0 0 8px; color: #a1a1aa; font-size: 12px; }
#wallet { position: sticky; top: 0; z-index: 5; background: #27272a; }
#prices { font-size: 13px; }
#prices th { position: sticky; top: 0; background: #27272a; }
#prices th, #prices td { text-align: left; padding-right: 16px; vertical-align: top; }
#prices th:nth-child(3), #prices td:nth-child(3), #prices th:nth-child(4), #prices td:nth-child(4) { text-align: right; white-space: nowrap; }
#prices td:nth-child(1), #prices td:nth-child(2) { white-space: nowrap; }
#prices td:nth-child(2), #prices td:nth-child(5) { color: #a1a1aa; font-size: 12px; }
#stock th { z-index: 1; }
#manage-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
}
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head button { height: 26px; padding: 0 10px; font-size: 12px; }
dialog.manage {
  width: min(760px, 92vw);
  max-height: 80vh;
  padding: 0;
  background: #27272a;
  color: #fafafa;
  border: 1px solid #52525b;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
dialog.manage[open] { display: flex; flex-direction: column; }
dialog.manage.wide { width: min(980px, 92vw); height: 80vh; }
dialog.manage::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog.manage header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #3f3f46;
}
dialog.manage header h2 { margin: 0; }
dialog.manage header button { height: 28px; font-size: 12px; }
.dialog-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.fleet-body { display: flex; gap: 32px; }
.manage-col { flex: 1; min-width: 0; }
h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: #d4d4d8; }
#prices-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px 0; }
#prices-head select { width: 140px; flex: none; }
#prices-head .hint { margin: 0; }
#sail-actions { position: sticky; bottom: 0; margin: 0 -16px -16px; padding: 8px 16px 12px; background: #27272a; border-top: 1px solid #3f3f46; }
#sail-actions #plan-error { min-height: 0; margin: 0 0 8px; }
#sail-actions #plan-error:empty { display: none; }
.thumb {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fafafa;
  font-size: 12px;
  font-weight: 700;
}
#events-wrap { flex: none; padding: 12px 16px 0; font-size: 13px; }
#events { color: #fdba74; }
#events:empty { display: none; }
#stock td small { color: #a1a1aa; font-size: 11px; }
.cargo-row small.restock { color: #71717a; font-size: 11px; }
#route-list { margin-bottom: 16px; font-size: 13px; }
#route-list .roster-row { padding: 4px 0; border-bottom: 1px solid #3f3f46; }
.route-new { margin-top: 8px; }
#route-fleet { width: 260px; }
#route-stops { margin-top: 12px; display: grid; gap: 8px; }
.route-stop { border: 1px solid #3f3f46; border-radius: 4px; padding: 8px 12px; }
.route-stop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.route-stop-head strong { width: 20px; }
.route-stop-head select { width: 200px; }
.route-stop-head button { margin-left: auto; height: 26px; font-size: 12px; }
.route-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.route-cols h4 { margin: 0 0 4px; font-size: 12px; font-weight: 400; color: #a1a1aa; }
.route-buy { display: grid; grid-template-columns: 24px 1fr 64px; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 13px; }
.route-buy small { color: #71717a; font-size: 11px; }
.route-buy input { width: 64px; height: 26px; padding: 0 6px; background: #3f3f46; border: 1px solid #52525b; border-radius: 4px; color: #fafafa; font: inherit; font-size: 13px; }
.route-sell label { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #fafafa; }
.route-sell .none { color: #71717a; font-size: 12px; }
#route-add { margin-top: 8px; height: 28px; font-size: 12px; }
#route-error { min-height: 18px; margin: 4px 0; color: #fca5a5; font-size: 13px; }
#route-start { background: #115e59; border-color: #14b8a6; font-weight: 700; }
#route-start:hover:not(:disabled) { background: #0f766e; }
#route-start:disabled { background: #303034; border-color: #3f3f46; }
#origin-dev { margin: 4px 0 0; }
#dlg-port { width: min(900px, 94vw); height: min(980px, 94vh); max-height: none; }
#dlg-port #port-body { scrollbar-gutter: stable; }
#dlg-port .port-tabs { position: sticky; top: -12px; z-index: 2; margin: 0 -16px 10px; padding: 8px 16px 0; background: #241c14; }
.port-sub { margin: 0 0 10px; color: #a1a1aa; font-size: 13px; }
.port-section { padding: 10px 0; border-top: 1px solid #3f3f46; }
.port-section:first-child { border-top: 0; padding-top: 0; }
.port-section h3 { margin-bottom: 6px; }
.dev-bar { height: 8px; margin: 6px 0; background: #18181b; border: 1px solid #3f3f46; }
.dev-bar > div { height: 100%; background: #14b8a6; }
.port-line { font-size: 13px; color: #d4d4d8; }
.port-line.dim { color: #a1a1aa; }
.port-table { font-size: 13px; }
.port-table th, .port-table td { padding: 4px 8px 4px 0; text-align: right; }
.port-table th:first-child, .port-table td:first-child, .port-table th:last-child, .port-table td:last-child { text-align: left; }
.port-table td:first-child { white-space: nowrap; }
.port-table .thumb { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.port-table td { vertical-align: middle; }
.port-chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.port-chips span { padding: 2px 6px; border: 1px solid #3f3f46; border-radius: 4px; }
.port-chips small { color: #a1a1aa; }
.port-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid #3f3f46; }
.port-actions button { height: 30px; }
.port-link { height: auto; padding: 0; background: none; border: 0; color: #fafafa; font-weight: 700; text-decoration: underline; text-decoration-color: #52525b; }
.port-link:hover:not(:disabled) { background: none; color: #5eead4; }
.port-trade-head { display: flex; align-items: center; gap: 12px; }
.port-trade-head select { width: 200px; }
.port-qty { white-space: nowrap; }
.port-qty input { width: 56px; height: 26px; padding: 0 6px; margin-right: 4px; background: #3f3f46; border: 1px solid #52525b; border-radius: 4px; color: #fafafa; font: inherit; font-size: 13px; }
.port-qty button { height: 26px; padding: 0 8px; font-size: 12px; }
.port-go { margin-top: 6px; height: 32px !important; background: #115e59; border-color: #14b8a6; font-weight: 700; }
.port-go:hover:not(:disabled) { background: #0f766e; }
.port-go:disabled { background: #303034; border-color: #3f3f46; }

/* ---------- 게임풍 버튼 ---------- */
button {
  background: #3b2f22;
  border: 2px solid #8a6a3a;
  border-radius: 3px;
  color: #f5e6c8;
  font-weight: 600;
  box-shadow: inset 0 1px 0 #6b5434, inset 0 -2px 0 #22190f, 0 2px 0 #0d0905;
  transition: background-color 100ms ease, border-color 100ms ease;
}
button:hover:not(:disabled) { background: #4b3c2b; border-color: #c49a52; }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 0 #22190f, 0 1px 0 #0d0905; }
button:disabled { color: #7a6f60; background: #2a2520; border-color: #4a4035; box-shadow: none; }
button.on, button[aria-pressed="true"] { background: #2f4a33; border-color: #7fbf8f; color: #e8f5e9; }
#play.attention, #sail-actions button, .port-go, #route-start, .menu-btn.primary { background: #6b4e1f; border-color: #e0b45a; color: #fff4d6; }
#play.attention:hover, .port-go:hover:not(:disabled), #route-start:hover:not(:disabled), .menu-btn.primary:hover { background: #82602a; }
.port-go:disabled, #route-start:disabled { background: #2a2520; border-color: #4a4035; color: #7a6f60; }
.menu-btn.danger { border-color: #b4553f; color: #ffd9cf; }
/* ---------- 아이콘: 글자 앞에 붙인다(본문 글자는 그대로) ---------- */
[data-icon]::before { content: attr(data-icon); margin-right: 6px; font-weight: 400; }
#wallet .company { margin-bottom: 4px; color: #e0b45a; font-size: 15px; }
/* ---------- 메인 화면 ---------- */
#menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 6, 0.72);
}
#menu[hidden] { display: none; }
.menu-panel {
  width: 360px;
  padding: 28px 28px 24px;
  background: #241c14;
  border: 3px double #a8844a;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-panel[hidden] { display: none; }
.menu-wide { width: 520px; }
.menu-title { margin: 0; text-align: center; font-size: 30px; color: #e0b45a; letter-spacing: 2px; }
.menu-sub { margin: 0 0 10px; text-align: center; color: #c8b896; font-size: 13px; }
.menu-heading { margin: 0 0 6px; color: #e0b45a; font-size: 20px; }
.menu-btn { height: 46px; font-size: 16px; text-align: left; padding: 0 16px; }
.menu-btn small { display: block; margin-top: -2px; color: #c8b896; font-size: 11px; font-weight: 400; }
#menu-continue { height: auto; padding: 8px 16px; }
.menu-panel label { margin: 4px 0 0; color: #c8b896; }
.menu-panel input[type="text"] { height: 34px; padding: 0 10px; background: #3b2f22; border: 2px solid #8a6a3a; border-radius: 3px; color: #f5e6c8; font: inherit; font-size: 14px; }
.menu-panel select { background: #3b2f22; border: 2px solid #8a6a3a; color: #f5e6c8; }
.menu-preview { margin-top: 6px; padding: 10px 12px; background: #1b150f; border: 1px solid #5a4630; border-radius: 3px; display: grid; gap: 4px; font-size: 13px; color: #eadcbc; }
.menu-warning { margin: 0; color: #f0b27a; font-size: 12px; }
.menu-note { margin: 4px 0 0; color: #a89878; font-size: 12px; }
.menu-row { display: flex; gap: 8px; margin-top: 8px; }
.menu-row .menu-btn { flex: 1; text-align: center; }
.menu-panel label.check { color: #eadcbc; }
/* ---------- 항구 정보 창 ---------- */
#dlg-port { background: #241c14; border: 3px double #a8844a; color: #f5e6c8; }
#dlg-port .port-head { background: #33271a; border-bottom: 2px solid #8a6a3a; }
#dlg-port .port-head h2 { display: inline; font-size: 22px; color: #f3d18a; letter-spacing: 1px; }
#port-stars { margin-left: 10px; color: #e0b45a; font-size: 15px; letter-spacing: 2px; }
#dlg-port .port-sub { color: #c8b896; }
.port-tabs { display: flex; gap: 4px; margin: 0 0 10px; border-bottom: 2px solid #8a6a3a; }
.port-tab { height: 34px; padding: 0 14px; border-bottom: 0; border-radius: 3px 3px 0 0; background: #2b2118; box-shadow: none; color: #c8b896; }
.port-tab.on { background: #6b4e1f; border-color: #e0b45a; color: #fff4d6; }
.port-pane[hidden] { display: none; }
#dlg-port .port-section { margin-bottom: 10px; padding: 10px 12px; background: #2b2118; border: 1px solid #4a3a26; border-radius: 3px; }
#dlg-port .port-section h3 { color: #e0b45a; }
#dlg-port .port-table th { background: transparent; color: #c8b896; }
#dlg-port .port-table td { border-color: #4a3a26; }
#dlg-port .dev-bar { background: #15100b; border-color: #5a4630; }
#dlg-port .dev-bar > div { background: #e0b45a; }
#dlg-port .port-chips span { border-color: #5a4630; background: #1f1812; }
#dlg-port .port-line.dim, #dlg-port .port-chips small { color: #a89878; }
#dlg-port .port-qty input { background: #1b150f; border-color: #8a6a3a; color: #f5e6c8; }

/* 출항을 막는 이유 */
.port-line.warn { color: #fb923c; font-weight: 700; }

/* 사이드바 화물칸 */
#cargo { margin-top: 12px; }
.cargo-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.cargo-head span[data-icon]::before { content: attr(data-icon); margin-right: 6px; }
.hold { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; padding: 4px; background: #1c1917; border: 2px solid #57432f; border-radius: 4px; }
.hold i { display: block; aspect-ratio: 1; background: #2e2a26; border-radius: 1px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.cargo-list { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.cargo-list th { text-align: right; font-weight: 400; color: #a1a1aa; padding: 2px 4px; }
.cargo-list th:first-child, .cargo-list td:first-child { text-align: left; }
.cargo-list td { text-align: right; padding: 3px 4px; border-top: 1px solid #3f3f46; white-space: nowrap; vertical-align: middle; }
.cargo-name { display: flex; align-items: center; gap: 6px; }
.cargo-list .thumb { width: 18px; height: 18px; font-size: 10px; }
.cargo-list small { display: block; font-size: 11px; }
.cargo-sum small { margin-left: 4px; font-size: 11px; }
.gain { color: #4ade80; }
.loss { color: #f87171; }
.cargo-list .none { text-align: left; color: #a1a1aa; }
.cargo-sum { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: #d4d4d8; }
#cargo .hint { margin: 4px 0 0; font-size: 11px; color: #a1a1aa; }
.swatch { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 6px; vertical-align: -1px; border-radius: 2px; }
.swatch:first-child { margin-left: 0; }

/* 함대 목록 카드의 화물 막대 */
.fleet-bar { display: flex; height: 6px; margin: 4px 0 2px; background: #2e2a26; border-radius: 3px; overflow: hidden; }
.fleet-fill { background: #65a30d; }
.fleet-sup { background: #0284c7; }
.fleet-item small.fleet-load { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 항해 중 일시정지 알림 */
#paused-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); height: auto; padding: 8px 16px; background: rgba(120, 53, 15, 0.92); border: 2px solid #fbbf24; color: #fef3c7; font-weight: 700; font-size: 14px; border-radius: 6px; cursor: pointer; animation: paused-pulse 1.6s ease-in-out infinite; }
#paused-banner span { margin-left: 10px; color: #fbbf24; }
#paused-banner[hidden] { display: none; }
@keyframes paused-pulse { 50% { box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.35); } }

/* 클릭 거래 */
.trade-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0 0 10px; padding: 8px 12px; background: #33271a; border: 1px solid #8a6a3a; border-radius: 3px; font-size: 13px; }
.trade-step .trade-last { flex-basis: 100%; margin-top: 4px; }
.trade-step button { min-width: 56px; height: 30px; }
.trade-step button.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; font-weight: 700; }
.trade-step .dim { color: #a1a1aa; margin-left: 2px; }
.step-cell { text-align: right; white-space: nowrap; }
.step-cell button { min-width: 92px; height: 28px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.step-cell button small { font-weight: 400; opacity: 0.85; }
.step-head { text-align: center !important; }
.coin { display: inline-block; width: 16px; height: 16px; flex: none; background: var(--coin) center / contain no-repeat; image-rendering: pixelated; }
.step-buy:not(:disabled) { background: #14532d; border-color: #22c55e; }
.step-sell:not(:disabled) { background: #7c2d12; border-color: #f97316; }
.port-table td.gain { color: #4ade80; }
.port-table td.loss { color: #f87171; }
/* 도착해서 명령을 기다리는 함대 카드 */
.fleet-item.arrived { border-color: #fbbf24; box-shadow: 0 0 0 1px #fbbf24 inset; }
.fleet-item.arrived small:nth-of-type(1) { color: #fbbf24; }

/* ---------- 항구 창: 시세 · 항구 · 조선소 ---------- */
canvas.pixel { image-rendering: pixelated; display: block; }
/* 항구 카드 */
#dlg-port .port-card { display: flex; gap: 16px; align-items: center; background: linear-gradient(180deg, #2f4a5c 0%, #2b2118 70%); }
.port-pic { flex: none; padding: 10px 14px 4px; background: radial-gradient(ellipse at 50% 85%, #1e5a73 0 45%, transparent 46%); }
.port-facts { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; }
.port-facts div { display: flex; flex-direction: column; }
.port-facts span { color: #a89878; font-size: 11px; }
.port-facts strong { color: #f5e6c8; font-size: 14px; }
/* 발전 트랙 */
.dev-track { display: flex; justify-content: space-between; position: relative; margin: 4px 6px 10px; }
.dev-track::before { content: ''; position: absolute; left: 14px; right: 14px; top: 13px; height: 3px; background: #4a3a26; }
.dev-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dev-node b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #1b150f; border: 2px solid #5a4630; color: #a89878; }
.dev-node small { font-size: 10px; color: #a89878; }
.dev-node.done b { background: #6b4f1d; border-color: #e0b45a; color: #fde68a; }
.dev-node.now b { background: #e0b45a; border-color: #fde68a; color: #241c14; box-shadow: 0 0 0 3px rgba(224, 180, 90, 0.3); }
.dev-node.now small { color: #fde68a; font-weight: 700; }
.dev-perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.dev-perks div { padding: 6px 8px; background: #1f1812; border: 1px solid #4a3a26; border-radius: 3px; display: flex; flex-direction: column; }
.dev-perks span { font-size: 11px; color: #a89878; }
.dev-perks strong { font-size: 15px; color: #f5e6c8; }
.dev-perks em { font-style: normal; font-size: 11px; color: #a89878; }
.dev-perks em.up { color: #4ade80; }
/* 정박 함대 */
.dock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.dock-card { height: auto; display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left; background: #1f1812; border: 1px solid #5a4630; }
.dock-card.on { border-color: #fbbf24; }
.dock-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dock-card small { color: #a89878; font-size: 11px; }
/* 시세판 */
.quote-notice { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; padding: 6px 10px; background: #1f1812; border-left: 3px solid #e0b45a; }
.quote-notice span { color: #a89878; font-size: 12px; }
.quote-notice strong { color: #fde68a; }
.quote-notice small { color: #a89878; margin-left: auto; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.cat-filter button { height: 26px; padding: 0 10px; font-size: 12px; border-left: 4px solid var(--cat, #8a6a3a); }
.cat-filter button.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; border-left-color: var(--cat, #fbbf24); }
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.quote-card { padding: 8px; background: #1f1812; border: 1px solid #4a3a26; border-radius: 3px; display: flex; flex-direction: column; gap: 4px; }
.quote-card.dim { opacity: 0.5; }
.quote-top { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.quote-top .thumb { width: 20px; height: 20px; font-size: 11px; }
.quote-price { display: flex; align-items: center; gap: 5px; font-size: 18px; font-weight: 700; color: #f3d18a; }
.quote-tags { display: flex; flex-wrap: wrap; gap: 3px; min-height: 16px; }
.quote-tags i { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 8px; background: #3f3f46; color: #e4e4e7; }
.quote-tags i.hot { background: #9a3412; color: #ffedd5; }
.quote-tags i.good { background: #14532d; color: #dcfce7; }
.quote-tags i.bad { background: #4a1d1d; color: #fecaca; }
.more-btn { margin-top: 8px; width: 100%; }
/* 항구 소식 */
.news-card { display: flex; gap: 10px; padding: 8px 10px; margin-bottom: 6px; background: #f1e3c2; color: #3b2a17; border: 1px solid #a8844a; border-radius: 2px; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }
.news-card.fashion { background: #f7dfe9; }
.news-icon { font-size: 26px; line-height: 1; }
.news-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.news-body strong { font-size: 15px; }
.news-body span { font-size: 12px; }
.news-body small { font-size: 11px; color: #6b5537; }
.news-bar { height: 5px; background: rgba(0, 0, 0, 0.15); border-radius: 3px; overflow: hidden; margin: 2px 0; }
.news-bar div { height: 100%; background: #b45309; }
/* 조선소 */
.yard-lock { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; background: #1f1812; border: 1px dashed #8a6a3a; }
.yard-lock .lock-icon { font-size: 30px; }
.yard-lock > div:last-child { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.yard-lock span { font-size: 12px; color: #a89878; }
.yard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 6px; }
.ship-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #1f1812; border: 1px solid #5a4630; border-radius: 3px; }
.ship-card.locked { opacity: 0.55; }
.ship-pic { display: grid; place-items: center; height: 72px; background: linear-gradient(180deg, #355f7a 0 62%, #1e4a63 62%); border-radius: 2px; }
.ship-head { display: flex; justify-content: space-between; align-items: center; }
.ship-head strong { font-size: 15px; color: #f3d18a; }
.ship-price { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.ship-stats { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.ship-stats div { display: grid; grid-template-columns: 40px 1fr 48px; align-items: center; gap: 6px; }
.ship-stats span:first-child { color: #a89878; }
.ship-stats b { text-align: right; font-weight: 400; color: #f5e6c8; }
.stat-bar { height: 6px; background: #120d08; border-radius: 3px; overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: #e0b45a; }
.ship-why { font-size: 11px; color: #fca5a5; }
.ship-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ship-btns button { height: 30px; font-weight: 700; }
.ship-btns button:first-child:not(:disabled) { background: #14532d; border-color: #22c55e; }

/* 함대 줄 빈 칸 */
.fleet-item.empty { border-style: dashed; background: transparent; opacity: 0.75; }
.fleet-item.empty:hover { opacity: 1; border-color: #fbbf24; }
.fleet-item.empty strong { color: #fbbf24; }
/* 조선소: 편입할 함대 고르기 */
.yard-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 12px; }
.yard-pick > span { color: #a89878; margin-right: 4px; }
.yard-pick button { height: 28px; border-left: 4px solid var(--fleet); }
.yard-pick button.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; border-left-color: var(--fleet); }
.yard-pick small { margin-left: auto; color: #a89878; }
.ship-buy { height: 30px; font-weight: 700; }
.ship-buy:not(:disabled) { background: #14532d; border-color: #22c55e; }
/* 새 함대 편성 창 */
#dlg-newfleet { background: #241c14; border: 3px double #a8844a; color: #f5e6c8; }
#dlg-newfleet header { background: #33271a; border-bottom: 2px solid #8a6a3a; gap: 12px; }
#dlg-newfleet header h2 { color: #f3d18a; }
#dlg-newfleet header .note { float: none; margin-left: auto; }
.nf-body { display: flex; gap: 12px; padding: 0 !important; overflow: hidden !important; }
#nf-ports { flex: none; width: 190px; overflow-y: auto; padding: 10px; background: #1b150f; border-right: 1px solid #4a3a26; }
#nf-ports h4 { margin: 10px 0 4px; font-size: 11px; color: #a89878; }
#nf-ports h4:first-child { margin-top: 0; }
.nf-port { width: 100%; height: 30px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; padding: 0 8px; text-align: left; }
.nf-port small { color: #e0b45a; font-size: 10px; }
.nf-port.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; }
#nf-ships { flex: 1; overflow-y: auto; padding: 12px 16px; }
#nf-ships h3 { color: #e0b45a; }
#dlg-newfleet .ship-card { background: #2b2118; }
/* 방금 한 거래 안내 줄: 늘 한 줄 높이를 차지한다 */
.trade-last { height: 20px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 교역소 상품 카드 격자 */
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.trade-card { display: flex; flex-direction: column; gap: 4px; padding: 7px 8px; background: #1f1812; border: 1px solid #4a3a26; border-radius: 3px; }
.trade-card.dim { opacity: 0.6; }
.trade-card.locked { opacity: 0.5; border-style: dashed; }
.tc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tc-head .thumb { width: 22px; height: 22px; font-size: 11px; flex: none; }
.tc-head strong { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-tag { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #6b4f1d; color: #fde68a; flex: none; }
.tc-stock { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.tc-stock small { font-size: 11px; color: #a89878; }
.tc-price { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 700; color: #f3d18a; }
.tc-price small { font-size: 11px; font-weight: 400; }
.tc-price .gain { color: #4ade80; }
.tc-price .loss { color: #f87171; }
.tc-note { font-size: 11px; color: #a89878; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-row { display: flex; justify-content: space-between; font-size: 11px; }
.tc-row span { color: #a89878; }
.tc-row b { font-weight: 400; color: #f5e6c8; }
.tc-row b.loss { color: #f87171; }
.trade-btn { width: 100%; height: 30px; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-weight: 700; }
.trade-btn small { font-weight: 400; opacity: 0.85; }
.trade-card.locked .tc-note { white-space: normal; }
.trade-btn { white-space: nowrap; overflow: hidden; padding: 0 4px; }
.trade-btn small { font-size: 11px; }
.trade-btn.short { box-shadow: inset 0 0 0 1px #fbbf24; }

/* ---------- 장부 창 ---------- */
#dlg-ledger { background: #241c14; border: 3px double #a8844a; color: #f5e6c8; height: min(900px, 92vh); }
#dlg-ledger header { background: #33271a; border-bottom: 2px solid #8a6a3a; }
#dlg-ledger header h2 { color: #f3d18a; }
#dlg-ledger .port-tabs { position: sticky; top: -12px; z-index: 2; margin: -12px -16px 10px; padding: 10px 16px 0; background: #241c14; }
#dlg-ledger .port-section { margin-bottom: 10px; padding: 10px 12px; background: #2b2118; border: 1px solid #4a3a26; border-radius: 3px; }
#dlg-ledger .port-section h3 { color: #e0b45a; }
.book-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.book-card { display: flex; flex-direction: column; padding: 10px 12px; background: #1f1812; border: 1px solid #8a6a3a; border-radius: 3px; }
.book-card span { font-size: 12px; color: #a89878; }
.book-card strong { font-size: 22px; }
.book-card small { font-size: 11px; color: #a89878; }
.gain { color: #4ade80; }
.loss { color: #f87171; }
.book-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: stretch; }
.book-col { display: flex; flex-direction: column; align-items: center; }
.book-col .up, .book-col .down { width: 100%; height: 50px; display: flex; justify-content: center; }
.book-col .up { align-items: flex-end; border-bottom: 1px solid #8a6a3a; }
.book-col .down { align-items: flex-start; }
.book-col i { display: block; width: 70%; border-radius: 2px; }
.book-col i.gain { background: #22c55e; }
.book-col i.loss { background: #ef4444; }
.book-col small { font-size: 10px; color: #a89878; }
.book-col.now small { color: #fde68a; font-weight: 700; }
.book-table { font-size: 12px; }
.book-table td, .book-table th { text-align: right; white-space: nowrap; }
.book-table td:first-child, .book-table th:first-child { text-align: left; }
.book-table td:first-child { display: flex; align-items: center; gap: 6px; }
.book-table .thumb { width: 18px; height: 18px; font-size: 10px; }
.book-table td.dim { color: #a89878; text-align: left; }
.log-list { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.log-list li { padding: 5px 8px 5px 10px; border-left: 3px solid #5a4630; border-bottom: 1px solid #3a2d1e; }
.log-list li.log-trade { border-left-color: #22c55e; }
.log-list li.log-cost { border-left-color: #ef4444; }
.log-list li.log-fleet { border-left-color: #38bdf8; }
.log-list li.log-news { border-left-color: #f59e0b; }
.log-list li.dim { color: #a89878; }
.book-table tr.me td { background: rgba(251, 191, 36, 0.1); font-weight: 700; }
.log-list li.log-rival { border-left-color: #a855f7; }
/* 규모 단계 꼬리표 */
.tier { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; background: #3f3f46; color: #e4e4e7; }
.tier-1 { background: #3f4a2a; color: #d9f99d; }
.tier-2 { background: #1e3a5f; color: #bfdbfe; }
.tier-3 { background: #5b3a0d; color: #fde68a; }
.tier-4 { background: #6b1d6b; color: #f5d0fe; }

/* 악조건 */
.risk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; font-size: 12px; }
.risk-head { color: #a89878; margin-right: 4px; }
.risk { font-style: normal; padding: 2px 8px; border-radius: 10px; }
.risk.high { background: #7f1d1d; color: #fecaca; }
.risk.mid { background: #78350f; color: #fde68a; }
.risk.low { background: #1f3a2a; color: #bbf7d0; }
.risk-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 6px; font-size: 12px; }
.risk-opts select { margin-left: 4px; }
.repair-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #3a2d1e; }
.repair-row > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.repair-row .hull { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 6px; font-size: 11px; }
.repair-row .hull b { text-align: right; font-weight: 400; }
.repair-row .ship-buy { width: 180px; }
.spoil { display: block; font-size: 10px; color: #a1a1aa; }
.spoil.now { color: #f87171; }
.roster-auto { display: block; margin-top: 8px; font-size: 12px; }
.risk-opts label { display: inline-flex; align-items: center; gap: 4px; }
.risk-opts select { width: auto; height: 26px; }
/* 값 오르내림: 상승 빨강, 하락 파랑 */
.tc-price .price-up { color: #f87171; }
.tc-price .price-down { color: #60a5fa; }

/* 정기 항로: 교역 방식, 항구 고르기 */
.route-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 10px; }
.route-mode button.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; font-weight: 700; }
.route-mode small { flex-basis: 100%; }
.route-auto { margin: 6px 0 0; }
#pick-banner { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); height: auto; padding: 8px 16px; background: rgba(15, 76, 92, 0.94); border: 2px solid #5eead4; color: #ccfbf1; font-weight: 700; border-radius: 6px; cursor: pointer; z-index: 5; }
#pick-banner span { margin-left: 10px; color: #5eead4; }
#pick-banner[hidden] { display: none; }

/* 항구 창 도시 사진 배경: 사진이 보이도록 덮개를 옅게, 글자는 반투명 칸 위에 */
#dlg-port.has-photo { background-image: linear-gradient(rgba(24, 18, 12, 0.45), rgba(24, 18, 12, 0.7)), var(--port-photo); background-size: cover; background-position: center; background-attachment: local; }
#dlg-port.has-photo .port-head { background: linear-gradient(90deg, rgba(24, 18, 12, 0.75) 0%, rgba(24, 18, 12, 0.1) 60%), var(--port-photo) center 40% / cover; min-height: 150px; align-items: flex-end; border-bottom: none; }
#dlg-port.has-photo .port-head h2 { text-shadow: 0 2px 6px #000, 0 0 2px #000; font-size: 28px; }
#dlg-port.has-photo #port-stars { text-shadow: 0 1px 3px #000; }
#dlg-port.has-photo #port-body { background: transparent; }
#dlg-port.has-photo .port-sub { display: inline-block; padding: 2px 8px; background: rgba(24, 18, 12, 0.75); border-radius: 3px; }
#dlg-port.has-photo .port-tabs { background: rgba(24, 18, 12, 0.85); }
#dlg-port.has-photo .port-section { background: rgba(36, 27, 19, 0.82); backdrop-filter: blur(3px); }
#dlg-port.has-photo .trade-card, #dlg-port.has-photo .quote-card, #dlg-port.has-photo .ship-card, #dlg-port.has-photo .dock-card { background: rgba(24, 18, 12, 0.85); }
#dlg-port.has-photo .trade-step { background: rgba(51, 39, 26, 0.85); }
.port-credit { padding: 2px 16px; font-size: 10px; color: #a89878; background: rgba(20, 15, 10, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-credit:empty { display: none; }
.port-credit a { color: #e0b45a; }

/* 해적 */
.news-card.pirate { background: #3b1d1d; color: #fde2e2; border-color: #7f1d1d; }
.news-card.pirate .news-icon { filter: grayscale(0.3); }
.news-card.pirate.stage-0 { background: #2f2f33; border-color: #52525b; color: #e4e4e7; }
.news-card.pirate.stage-1 { background: #4a2a12; border-color: #9a3412; }
.arm-box { margin-top: 12px; padding-top: 8px; border-top: 1px solid #4a3a26; }
.arm-box h4 { margin: 0 0 4px; color: #e0b45a; }

/* 약탈품 시장, 정기 항로 해적 설정 */
#dlg-port .port-section.loot-sec { border-color: #7f1d1d; background: rgba(59, 29, 29, 0.85); }
.loot-sec h3 { color: #fca5a5 !important; }
.route-check { display: flex; align-items: center; gap: 4px; font-size: 12px; flex-basis: 100%; }

/* 항구 창 칸 색: 갈색 → 짙은 바다색(남색). 사진이 있든 없든 같은 색 */
#dlg-port .port-section, #dlg-port.has-photo .port-section { background: rgba(14, 30, 46, 0.86); border-color: #2c4a63; }
#dlg-port .trade-card, #dlg-port .quote-card, #dlg-port .ship-card, #dlg-port .dock-card, #dlg-port .dev-perks div, #dlg-port .yard-lock,
#dlg-port.has-photo .trade-card, #dlg-port.has-photo .quote-card, #dlg-port.has-photo .ship-card, #dlg-port.has-photo .dock-card { background: rgba(8, 20, 32, 0.9); border-color: #27445c; }
#dlg-port .trade-step, #dlg-port.has-photo .trade-step { background: rgba(18, 40, 60, 0.88); border-color: #3b6585; }
#dlg-port .port-line.dim, #dlg-port .tc-note, #dlg-port .tc-stock small, #dlg-port .tc-row span, #dlg-port .ship-stats span:first-child,
#dlg-port .port-facts span, #dlg-port .dev-perks span, #dlg-port .dev-node small { color: #9fb6cc; }
#dlg-port .stat-bar { background: #061220; }
#dlg-port .port-table td { border-color: #27445c; }
#dlg-port .repair-row { border-top-color: #27445c; }
#dlg-port .port-card, #dlg-port.has-photo .port-card { background: linear-gradient(180deg, rgba(30, 70, 95, 0.9) 0%, rgba(14, 30, 46, 0.9) 70%); }
#dlg-port .port-section.loot-sec { background: rgba(59, 29, 29, 0.88); border-color: #7f1d1d; }
#dlg-port .port-tabs, #dlg-port.has-photo .port-tabs { background: rgba(10, 24, 38, 0.94); border-bottom-color: #3b6585; }
#dlg-port.has-photo .port-sub { background: rgba(10, 24, 38, 0.85); }
.rename-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rename-row span { font-size: 12px; color: #a1a1aa; }
.rename-row input { width: 160px; }

/* 상단 정보 창 */
#dlg-rival { background: #0e1e2e; border: 3px double #3b6585; color: #e2e8f0; height: min(820px, 90vh); }
#dlg-rival header { background: #12283c; border-bottom: 3px solid var(--rival, #fbbf24); }
#dlg-rival header h2 { color: #f3d18a; }
.rival-head { display: flex; align-items: flex-end; min-height: 110px; padding: 12px 16px; margin: -12px -16px 12px; background-size: cover; background-position: center; border-left: 6px solid var(--rival, #fbbf24); }
.rival-head div { display: flex; flex-direction: column; gap: 4px; }
.rival-head strong { font-size: 24px; color: #fff; text-shadow: 0 2px 4px #000; }
.rival-head small { color: #cbd5e1; text-shadow: 0 1px 2px #000; }
.rival-stats { grid-template-columns: repeat(3, 1fr); }
#dlg-rival .book-card { background: rgba(8, 20, 32, 0.9); border-color: #27445c; }
#dlg-rival .book-card strong { font-size: 16px; color: #f3d18a; }
#dlg-rival .port-section { margin-bottom: 10px; padding: 10px 12px; background: rgba(14, 30, 46, 0.86); border: 1px solid #2c4a63; border-radius: 3px; }
#dlg-rival .port-section h3 { color: #e0b45a; }
.rival-chip { display: block; width: 100%; height: auto; margin-top: 4px; padding: 6px 10px; text-align: left; border-left: 6px solid var(--rival); }
.quote-tags i.rival { background: #3b2a5a; color: #e9d5ff; }
.book-table tr.rival-row { cursor: pointer; }
.book-table tr.rival-row:hover td { background: rgba(251, 191, 36, 0.06); }

/* ---------- 정기 항로 창(게임 화면) ---------- */
#dlg-route { background: #0e1e2e; border: 3px double #a8844a; color: #e2e8f0; height: min(900px, 92vh); }
#dlg-route header { background: #12283c; border-bottom: 2px solid #8a6a3a; }
#dlg-route header h2 { color: #f3d18a; }
.route-panel { margin-bottom: 12px; padding: 10px 12px; background: rgba(14, 30, 46, 0.86); border: 1px solid #2c4a63; border-radius: 3px; }
.route-panel h3 { color: #e0b45a; margin-bottom: 8px; }
.route-run { margin-bottom: 8px; padding: 8px 10px; background: rgba(8, 20, 32, 0.9); border: 1px solid #27445c; border-left: 5px solid var(--fleet); border-radius: 3px; }
.route-run-top { display: flex; align-items: center; gap: 8px; }
.route-run-top span { flex: 1; font-size: 12px; color: #9fb6cc; }
.route-badge { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #1e3a5f; color: #bfdbfe; }
.route-run-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; font-size: 13px; }
.route-run-port { padding: 2px 8px; border-radius: 3px; background: #172a3d; }
.route-run-port.now { background: #a16207; color: #fffbeb; font-weight: 700; }
.route-run-chain .arrow { font-style: normal; color: #e0b45a; }
.route-run-bar { height: 5px; background: #061220; border-radius: 3px; overflow: hidden; }
.route-run-bar div { height: 100%; background: #5eead4; }
.route-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.route-top select { width: auto; min-width: 260px; }
.route-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 10px 0; }
.route-card { width: 150px; display: flex; flex-direction: column; gap: 3px; padding: 0 0 6px; background: rgba(8, 20, 32, 0.92); border: 1px solid #27445c; border-radius: 4px; overflow: hidden; cursor: pointer; }
.route-card.on { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35); }
.route-card-pic { height: 64px; background: #1e3a5f center / cover; position: relative; }
.route-card-pic b { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #e0b45a; color: #241c14; font-size: 12px; }
.route-card strong { padding: 0 8px; font-size: 14px; color: #f3d18a; }
.route-card small { padding: 0 8px; font-size: 10px; color: #9fb6cc; }
.route-card-tools { display: flex; gap: 3px; padding: 0 6px; margin-top: auto; }
.route-card-tools button { flex: 1; height: 22px; padding: 0; font-size: 11px; }
.route-card.add { height: auto; align-items: center; justify-content: center; border-style: dashed; background: transparent; color: #e0b45a; padding: 10px; }
.route-card.add span { font-size: 26px; line-height: 1; }
.route-card.add small { color: #9fb6cc; }
.route-arrow { display: flex; align-items: center; color: #e0b45a; font-size: 20px; }
.route-arrow.loop { font-size: 22px; color: #5eead4; }
#route-detail { margin-bottom: 8px; }
.route-detail-title { color: #e0b45a; margin: 4px 0 6px; }
.route-summary { grid-template-columns: repeat(4, 1fr); }
#dlg-route .book-card { background: rgba(8, 20, 32, 0.9); border-color: #27445c; }
#dlg-route .book-card strong { font-size: 13px; color: #f5e6c8; }
#route-start { width: 100%; height: 40px; font-size: 15px; }
#route-stops.route-chain { display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; }
#route-stops.route-chain > * { flex: none; }
.rival-head .tier { align-self: flex-start; }

/* 지난달 대비 값 변화 배지: 상승 빨강, 하락 파랑, 동결 회색 */
.tc-price .trend { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px 1px 4px; border-radius: 3px; border: 1px solid; font-size: 11px; font-weight: 700; line-height: 16px; vertical-align: middle; }
.tc-price .trend svg { width: 11px; height: 11px; fill: currentColor; }
.tc-price .trend em { font-style: normal; }
.tc-price .trend-up { color: #fca5a5; background: rgba(127, 29, 29, 0.55); border-color: #b91c1c; }
.tc-price .trend-down { color: #93c5fd; background: rgba(30, 58, 138, 0.55); border-color: #2563eb; }
.tc-price .trend-flat { color: #cbd5e1; background: rgba(51, 65, 85, 0.55); border-color: #64748b; }
.tc-price { flex-wrap: wrap; row-gap: 2px; }
.tc-price .trend { white-space: nowrap; }

/* 배 카드: 군선 전투력 막대 */
.ship-stats .warship .stat-bar > span { background: #dc2626; }
.ship-stats .warship b { color: #fca5a5; }

/* 함대 관리 창(게임 화면): 남색 판, 금색 제목, 함대 색 띠 */
#dlg-fleet { background: #0e1e2e; border: 3px double #3b6585; color: #e2e8f0; height: min(820px, 90vh); }
#dlg-fleet header { background: #12283c; border-bottom: 3px solid var(--fleet, #fbbf24); }
#dlg-fleet header h2 { color: #f3d18a; }
#dlg-fleet .fleet-body { display: block; }
#dlg-fleet .port-section { margin-bottom: 10px; padding: 10px 12px; background: rgba(14, 30, 46, 0.86); border: 1px solid #2c4a63; border-radius: 3px; }
#dlg-fleet .port-section h3 { color: #e0b45a; margin: 0 0 8px; }
.fm-head { display: flex; align-items: flex-end; min-height: 96px; padding: 12px 16px; margin: -12px -16px 12px; background: #12283c center / cover; border-left: 6px solid var(--fleet, #fbbf24); }
.fm-head > div { display: flex; flex-direction: column; gap: 4px; }
.fm-name { width: 260px; height: auto; padding: 2px 6px; font-size: 24px; font-weight: 700; color: #fff; background: transparent; border: 1px dashed transparent; border-radius: 3px; text-shadow: 0 2px 4px #000; }
.fm-name:hover, .fm-name:focus { border-color: #fbbf24; background: rgba(0, 0, 0, 0.4); outline: none; }
.fm-head small { color: #cbd5e1; text-shadow: 0 1px 2px #000; padding-left: 7px; }
.fm-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.fm-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 8px 10px; background: rgba(8, 20, 32, 0.9); border: 1px solid #27445c; border-radius: 3px; }
.fm-stat i { grid-row: span 2; font-style: normal; font-size: 20px; }
.fm-stat span { font-size: 11px; color: #94a3b8; }
.fm-stat strong { font-size: 15px; color: #f3d18a; }
.fm-stat.power { border-color: #7f1d1d; background: rgba(60, 12, 12, 0.6); }
.fm-stat.power strong { color: #fca5a5; }
.fm-policy { display: flex; gap: 6px; margin-bottom: 8px; }
.fm-pol { flex: 1; height: 34px; }
.fm-pol.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; font-weight: 700; }
.fm-meter { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fm-bar { position: relative; flex: 1; height: 14px; background: #1e293b; border: 1px solid #334155; border-radius: 2px; }
.fm-bar > span { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, #b91c1c, #f59e0b, #16a34a); }
.fm-bar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; box-shadow: 0 0 3px #000; }
.fm-meter b { min-width: 72px; text-align: center; padding: 3px 8px; border-radius: 3px; font-size: 13px; }
.fm-meter b.fight { background: rgba(127, 29, 29, 0.7); color: #fecaca; border: 1px solid #dc2626; }
.fm-meter b.flee { background: rgba(30, 58, 138, 0.6); color: #bfdbfe; border: 1px solid #2563eb; }
.fm-ships { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fm-ship { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(8, 20, 32, 0.9); border: 1px solid #27445c; border-left: 4px solid var(--fleet, #fbbf24); border-radius: 3px; }
.fm-ship.war { border-color: #7f1d1d; border-left-color: #dc2626; }
.fm-pic { display: grid; place-items: center; height: 60px; background: radial-gradient(#1d4e74, #0b2236); border: 1px solid #27445c; border-radius: 2px; }
.fm-pic canvas { image-rendering: pixelated; }
.fm-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fm-info strong { color: #f8fafc; font-size: 14px; }
.fm-info small { color: #94a3b8; font-size: 11px; }
.fm-hull { display: grid; grid-template-columns: 40px 1fr 38px; align-items: center; gap: 6px; font-size: 11px; color: #94a3b8; }
.fm-hull b { text-align: right; color: #e2e8f0; font-weight: 400; }
.fm-hull .stat-bar > span { background: #16a34a; }
.fm-hull.warn .stat-bar > span { background: #f59e0b; }
.fm-hull.bad .stat-bar > span { background: #dc2626; }
.fm-gear { display: flex; gap: 4px; }
.fm-gear span { padding: 1px 6px; font-size: 11px; border: 1px solid #334155; border-radius: 2px; color: #64748b; }
.fm-gear span.on { color: #fde68a; border-color: #a16207; background: rgba(120, 53, 15, 0.5); }
.fm-gear span.empty { border-style: dashed; }
.fm-acts { display: flex; flex-direction: column; gap: 4px; }
.fm-acts button { white-space: nowrap; }
.fm-merge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 사이드바: 함대 수익 */
#fleet-profit { margin-top: 14px; }
.fp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.fp-head span { font-size: 13px; color: #e4e4e7; }
.fp-head span::before { content: attr(data-icon); margin-right: 6px; }
.fp-head small { font-size: 11px; color: #a1a1aa; }
.fp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 6px; }
.fp-card { display: flex; flex-direction: column; gap: 2px; padding: 5px 7px; background: #1c1917; border: 1px solid #3f3a33; border-radius: 3px; }
.fp-card span { font-size: 10px; color: #a1a1aa; }
.fp-card strong { font-size: 13px; color: #e4e4e7; }
.fp-card strong.gain { color: #4ade80; }
.fp-card strong.loss { color: #f87171; }
.fp-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; height: 76px; padding: 4px; background: #141210; border: 1px solid #3f3a33; border-radius: 3px; }
.fp-col { display: grid; grid-template-rows: 1fr 1fr auto; text-align: center; }
.fp-up, .fp-down { position: relative; }
.fp-up { border-bottom: 1px solid #52525b; }
.fp-up i, .fp-down i { position: absolute; left: 18%; right: 18%; }
.fp-up i { bottom: 0; }
.fp-down i { top: 0; }
.fp-col .gain-bar { background: #16a34a; }
.fp-col .loss-bar { background: #dc2626; }
.fp-col.now i { opacity: 0.55; }
.fp-col small { font-size: 9px; color: #a1a1aa; }
#fleet-profit .hint { margin: 4px 0 0; font-size: 10px; color: #71717a; }

/* 저장 칸 목록(불러오기·저장하기) */
.slot-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.slot-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(20, 16, 12, 0.85); border: 1px solid #5c4630; border-radius: 3px; }
.slot-row.empty { opacity: 0.6; }
.slot-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.slot-info strong { color: #f3d18a; font-size: 14px; }
.slot-info span { color: #e7e5e4; font-size: 12px; }
.slot-info small { color: #a8a29e; font-size: 11px; }
.slot-row .slot-act { width: auto; min-width: 110px; margin: 0; padding: 6px 12px; }
.slot-row .slot-del { width: 30px; height: 30px; padding: 0; }
#menu.in-game { background: rgba(5, 10, 16, 0.72); }
.slot-del-space { width: 30px; flex: none; }

/* 새로하기 옵션 */
.new-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0; }
.new-opts b { margin-left: auto; color: #f3d18a; font-size: 13px; }
.menu-label { display: block; margin-top: 10px; font-size: 13px; color: #d6c3a0; }
/* 크레딧 */
.credits { width: 640px; max-height: 88vh; display: flex; flex-direction: column; }
.credit-body { overflow-y: auto; max-height: 62vh; padding-right: 6px; text-align: left; }
.credit-body h3 { margin: 12px 0 4px; color: #f3d18a; font-size: 15px; }
.credit-body p, .credit-body li { font-size: 12px; color: #e7e5e4; line-height: 1.6; }
.credit-body a { color: #fbbf24; }
.credit-photos { columns: 2; column-gap: 18px; padding-left: 16px; }
.credit-photos li { break-inside: avoid; color: #a8a29e; }
/* 도움말 */
#dlg-help { background: #0e1e2e; border: 3px double #3b6585; color: #e2e8f0; height: min(820px, 90vh); }
#dlg-help header { background: #12283c; border-bottom: 3px solid #fbbf24; }
#dlg-help header h2 { color: #f3d18a; }
#dlg-help .port-section { margin-bottom: 10px; padding: 10px 14px; background: rgba(14, 30, 46, 0.86); border: 1px solid #2c4a63; border-radius: 3px; }
#dlg-help .port-section h3 { color: #e0b45a; margin: 0 0 8px; }
.help-steps, .help-tips { margin: 0; padding-left: 20px; line-height: 1.75; font-size: 13px; }
.help-steps b { color: #fde68a; }
.help-body code { padding: 0 5px; background: #1e3a52; border-radius: 2px; color: #fde68a; font-size: 12px; }
.help-keys { border-collapse: collapse; font-size: 13px; }
.help-keys th { min-width: 150px; padding: 4px 12px 4px 0; text-align: left; color: #fde68a; font-weight: 700; }
.help-keys td { padding: 4px 0; color: #e2e8f0; }
.hk-up { color: #fca5a5; } .hk-down { color: #93c5fd; } .hk-flat { color: #cbd5e1; }
/* 기록·업적 */
.rec-cards { grid-template-columns: repeat(5, 1fr); }
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(20, 18, 16, 0.85); border: 1px solid #3f3a33; border-radius: 3px; opacity: 0.7; }
.ach.got { opacity: 1; border-color: #a16207; background: rgba(66, 42, 8, 0.6); }
.ach i { font-style: normal; font-size: 24px; }
.ach > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ach strong { font-size: 13px; color: #f3d18a; }
.ach small { font-size: 11px; color: #a8a29e; }
.ach em { font-style: normal; font-size: 10px; color: #fbbf24; }
.help-keys { width: auto; }
.help-keys td { text-align: left; }

/* 사이드바: 메인 목표·받은 의뢰 */
#missions-panel { padding-top: 10px; padding-bottom: 10px; }
.ms-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ms-head span { font-size: 14px; font-weight: 700; color: #f3d18a; }
.ms-head span::before { content: attr(data-icon); margin-right: 6px; }
.ms-head small { font-size: 11px; color: #a1a1aa; }
.ms-head small.loss { color: #f87171; }
.ms-goal { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; align-items: center; font-size: 12px; color: #e4e4e7; padding: 1px 0; }
.ms-goal i { font-style: normal; color: #fbbf24; text-align: center; }
.ms-goal.opt { color: #a1a1aa; }
.ms-goal b { font-weight: 400; color: #a1a1aa; font-size: 11px; }
.ms-goal.done { color: #4ade80; text-decoration: line-through; opacity: 0.7; }
.ms-goal.done i { color: #4ade80; }
.ms-goal.failed i, .ms-goal.failed b { color: #f87171; }
.ms-goal.expired { opacity: 0.45; text-decoration: line-through; }
.ms-sub { margin-top: 6px; font-size: 12px; color: #d6d3d1; }
.ms-req { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: #d4d4d8; padding: 2px 4px; cursor: pointer; border-radius: 2px; }
.ms-req:hover { background: rgba(251, 191, 36, 0.08); }
.ms-req span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-req b { font-weight: 400; color: #a1a1aa; white-space: nowrap; }
.ms-req b.loss { color: #f87171; }
/* 의뢰 카드 */
.req-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.req-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: rgba(40, 30, 16, 0.85); border: 1px solid #6b5230; border-left: 4px solid #d97706; border-radius: 3px; }
.req-card.req-urgent { border-left-color: #dc2626; }
.req-card.req-pirate { border-left-color: #7c3aed; }
.req-card.on { background: rgba(20, 40, 28, 0.85); border-color: #2f6b45; }
.req-top { display: flex; justify-content: space-between; align-items: baseline; }
.req-top b { color: #fde68a; font-size: 13px; }
.req-top span { font-size: 11px; color: #a8a29e; }
.req-card p { margin: 0; font-size: 12px; color: #e7e5e4; line-height: 1.5; }
.req-meta { display: flex; gap: 10px; font-size: 11px; }
.req-meta .gain { color: #4ade80; }
.req-meta .rep { color: #fbbf24; }
.req-meta .loss { color: #f87171; }
.req-prog { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: #d6d3d1; }
.req-acts { display: flex; gap: 6px; }
.req-acts .req-go { flex: 1; }
.req-card .req-go { background: #166534; border-color: #22c55e; color: #f0fdf4; font-weight: 700; }
.req-card .req-go:disabled { background: #27272a; border-color: #3f3f46; color: #71717a; }
.req-quit { width: auto; }
/* 장부: 장 카드, 평판 */
.ch-card { margin-bottom: 8px; padding: 10px 12px; border: 1px solid #3f3a33; border-radius: 3px; background: rgba(20, 18, 16, 0.85); }
.ch-card.ch-now { border-color: #d97706; background: rgba(66, 42, 8, 0.6); }
.ch-card.ch-later { opacity: 0.55; }
.ch-card.ch-done { border-color: #166534; }
.ch-top { display: flex; justify-content: space-between; }
.ch-top b { color: #f3d18a; }
.ch-top span { font-size: 12px; color: #a8a29e; }
.ch-card p { margin: 4px 0; font-size: 12px; color: #d6d3d1; font-style: italic; }
.ch-card ul { margin: 0; padding-left: 4px; list-style: none; font-size: 12px; line-height: 1.7; }
.ch-card li.done { color: #4ade80; }
.ch-card li.failed { color: #f87171; }
.ch-card li.expired { opacity: 0.5; text-decoration: line-through; }
.rep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rep-card { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: rgba(20, 18, 16, 0.85); border: 1px solid #3f3a33; border-radius: 3px; }
.rep-card > div { display: flex; justify-content: space-between; }
.rep-card strong { font-size: 13px; color: #e7e5e4; }
.rep-card b { font-size: 12px; color: #fbbf24; }
.rep-card small { font-size: 11px; color: #a8a29e; }
.rep-card .stat-bar > span { background: #fbbf24; }
.rep-t0 b { color: #a1a1aa; } .rep-t3 { border-color: #a16207; } .rep-t4 { border-color: #fbbf24; background: rgba(66, 42, 8, 0.6); }
.ship-price.discount { color: #4ade80; }

/* 대출 */
.loan-btn { height: 24px; padding: 0 10px; font-size: 12px; }
.loan-btn.debt { border-color: #dc2626; color: #fecaca; animation: paused-pulse 1.2s infinite; }
#dlg-loan { background: #1c1712; border: 3px double #8a6a45; color: #e7e5e4; width: min(720px, 94vw); }
#dlg-loan header { background: #2a2016; border-bottom: 3px solid #fbbf24; }
#dlg-loan header h2 { color: #f3d18a; }
#dlg-loan .port-section { margin-bottom: 10px; padding: 10px 12px; background: rgba(40, 30, 18, 0.85); border: 1px solid #5c4630; border-radius: 3px; }
#dlg-loan .port-section h3 { color: #e0b45a; margin: 0 0 8px; }
.loan-cards { grid-template-columns: repeat(5, 1fr); margin-bottom: 10px; }
.loan-warn { margin: 0 0 8px; padding: 8px 10px; background: rgba(127, 29, 29, 0.5); border: 1px solid #dc2626; border-radius: 3px; color: #fecaca; font-size: 13px; }
.loan-terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.loan-term { display: flex; flex-direction: column; gap: 2px; height: auto; padding: 8px; }
.loan-term b { font-size: 14px; }
.loan-term span { color: #fbbf24; }
.loan-term small { font-size: 10px; color: #a8a29e; }
.loan-term.on, .loan-amt.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; }
.loan-amounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.loan-amt { width: auto; padding: 0 12px; }
.loan-amt.debt { border-color: #dc2626; }
.loan-go { width: 100%; height: 36px; margin-top: 6px; background: #166534; border-color: #22c55e; color: #f0fdf4; font-weight: 700; }
.loan-go:disabled { background: #27272a; border-color: #3f3f46; color: #71717a; }
.loan-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #3a2d1e; }
.loan-row > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.loan-row small { color: #a8a29e; font-size: 11px; }
.loan-row .stat-bar > span { background: #4ade80; }
.loan-cards .book-card strong { font-size: 15px; white-space: nowrap; }
.menu-hint { font-size: 11px; color: #a8a29e; font-weight: 400; }

/* 왼쪽 임무 창(지도 위) */
#view { position: relative; }
#missions-float { position: absolute; top: 56px; left: 12px; z-index: 5; width: 290px; max-height: calc(100% - 180px); overflow: auto; padding: 8px 10px; background: rgba(22, 17, 12, 0.9); border: 2px solid #6b5230; border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
#missions-float.closed { width: auto; padding: 4px; }
#missions-float.closed #missions-panel { display: none; }
#missions-toggle { width: 100%; height: 24px; margin-bottom: 6px; font-size: 12px; }
#missions-float.closed #missions-toggle { margin: 0; }
#missions-panel:empty { display: none; }
/* 날씨 소식 카드 */
.news-card.storm { border-left-color: #0ea5e9; }
.news-card.storm.scale-4, .news-card.storm.scale-5 { border-left-color: #dc2626; background: rgba(127, 29, 29, 0.25); }
.news-card.storm small { color: #fca5a5; }
/* 함대 관리: 수리 */
.fm-repair { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #27445c; }
.fm-repair span { font-size: 13px; }
.fm-repair button { width: auto; padding: 0 14px; }
/* 태풍 소식 카드: 어두운 판, 밝은 글씨 */
.news-card.storm { background: rgba(12, 32, 48, 0.92); border: 1px solid #1e5a7a; border-left: 5px solid #0ea5e9; color: #e0f2fe; }
.news-card.storm strong { color: #bae6fd; }
.news-card.storm span { color: #e2e8f0; }
.news-card.storm small { color: #93c5fd; }
.news-card.storm.scale-3 { border-left-color: #f59e0b; }
.news-card.storm.scale-3 small { color: #fcd34d; }
.news-card.storm.scale-4, .news-card.storm.scale-5 { background: rgba(60, 14, 14, 0.92); border-color: #7f1d1d; border-left-color: #ef4444; }
.news-card.storm.scale-4 strong, .news-card.storm.scale-5 strong { color: #fecaca; }
.news-card.storm.scale-4 small, .news-card.storm.scale-5 small { color: #fca5a5; }

/* 시세 모름 */
.tc-price .fog { font-size: 13px; color: #94a3b8; font-weight: 400; }
.fog-note { margin: 8px 0; padding: 10px 12px; background: rgba(51, 65, 85, 0.5); border: 1px dashed #64748b; border-radius: 3px; color: #cbd5e1; font-size: 13px; }
/* 의뢰 카드: 의뢰인 머리, 등급, 연쇄, 잠김 */
.req-client { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #d6d3d1; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 4px; }
.req-client i { font-style: normal; font-size: 14px; }
.req-client span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-client b { color: #fbbf24; letter-spacing: 1px; }
.req-card.req-proxy { border-left-color: #0891b2; }
.req-card.req-transport { border-left-color: #2563eb; }
.req-card.req-contract { border-left-color: #16a34a; }
.req-card.req-explore { border-left-color: #a855f7; }
.req-card.chain { border: 2px solid #fbbf24; background: rgba(66, 42, 8, 0.75); }
.req-card.locked { opacity: 0.55; border-style: dashed; }
.req-why { color: #fca5a5; font-size: 11px; }
.ms-req.empty { color: #78716c; cursor: default; }

/* ===== 상단 HUD (2026-11-08) ===== */
#map-tools, #manage-tools { display: none; }
#panel #wallet { display: none; }
#hud { position: absolute; top: 0; left: 0; right: 0; z-index: 8; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud-top { position: relative; display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 12px; background: linear-gradient(#2a1f14, #1a130c); border-bottom: 2px solid #a16207; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6); }
.hud-left { display: flex; align-items: center; gap: 14px; }
.hud-mark { display: flex; align-items: center; gap: 8px; padding-right: 14px; border-right: 1px solid #5c4630; }
#company-flag { display: grid; place-items: center; width: 30px; height: 30px; font-size: 18px; color: #fde68a; background: radial-gradient(#7c2d12, #431407); border: 2px solid #fbbf24; border-radius: 50%; box-shadow: 0 0 6px rgba(251, 191, 36, 0.5); }
.hud-mark div { display: flex; flex-direction: column; line-height: 1.15; }
.hud-mark strong { color: #fde68a; font-size: 15px; }
.hud-mark small { color: #d6c3a0; font-size: 11px; }
.hud-gold { display: flex; align-items: center; gap: 8px; }
.hud-coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fef3c7, #f59e0b 55%, #92400e); box-shadow: 0 0 0 2px #78350f; }
.hud-gold div { display: flex; flex-direction: column; line-height: 1.15; }
.hud-gold strong { font-size: 18px; color: #fbbf24; font-variant-numeric: tabular-nums; }
.hud-gold strong.debt { color: #f87171; }
.hud-gold small { color: #a8a29e; font-size: 11px; }
.hud-gold small b { color: #e7e5e4; font-weight: 400; }
.hud-clock { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 16px; background: linear-gradient(#3a2a18, #20160d); border: 2px solid #fbbf24; border-radius: 0 0 14px 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7); height: 52px; }
.hud-clock strong { font-size: 17px; color: #fffbeb; letter-spacing: 0.5px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.hud-clock #play { height: 36px; min-width: 104px; font-weight: 700; font-size: 14px; }
.hud-right { color: #fde68a; font-size: 13px; }
#hud-tools { display: flex; gap: 4px; justify-content: center; padding: 4px 8px; margin: 0 auto; width: fit-content; background: rgba(26, 19, 12, 0.92); border: 1px solid #5c4630; border-top: none; border-radius: 0 0 8px 8px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); margin-top: 10px; }
#hud-tools button { height: 30px; padding: 0 12px; font-size: 13px; }
/* 디버그 창·배너는 HUD 아래로 */
#debug { top: 104px; }
#pick-banner, #paused-banner { top: 108px !important; }
/* 소식 아이콘(왼쪽 세로 줄) */
#news-icons { position: absolute; top: 104px; left: 10px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.news-icon-btn { width: 44px; height: 44px; padding: 0; font-size: 22px; border-radius: 50%; background: radial-gradient(#3a2a18, #1a130c); border: 2px solid #a16207; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); animation: notice-in 0.4s ease-out; }
.news-icon-btn:hover, .news-icon-btn.on { border-color: #fde68a; transform: scale(1.08); }
.news-clear { width: 44px; height: 22px; padding: 0; font-size: 10px; border-radius: 10px; }
@keyframes notice-in { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
#news-pop { position: absolute; left: 62px; z-index: 7; width: 300px; margin-top: 104px; padding: 10px 12px; background: rgba(26, 19, 12, 0.97); border: 2px solid #fbbf24; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7); color: #f5f5f4; }
#news-pop .np-head { display: flex; justify-content: space-between; align-items: center; }
#news-pop .np-head i { font-style: normal; font-size: 22px; }
#news-pop .np-head small { color: #a8a29e; }
#news-pop p { margin: 6px 0 8px; font-size: 13px; line-height: 1.55; }
#news-pop .np-acts { display: flex; gap: 6px; justify-content: flex-end; }
#news-pop .np-acts button { width: auto; padding: 0 12px; }
/* 임무 창은 소식 줄 오른쪽 */
#missions-float { top: 104px; left: 64px; }
/* 판매 버튼 이익 */
.trade-btn em.profit { font-style: normal; font-size: 11px; margin-left: 4px; font-weight: 700; }
.trade-btn em.profit.gain { color: #4ade80; }
.trade-btn em.profit.loss { color: #f87171; }
.trade-btn.step-sell { flex-wrap: wrap; height: auto; min-height: 34px; row-gap: 0; padding-top: 3px; padding-bottom: 3px; }
.trade-btn.step-sell em.profit { flex-basis: 100%; text-align: center; margin-left: 0; }

/* ===== UI 재검토 (2026-11-08) ===== */
/* 왼쪽 묶음: 임무 창 → 소식 아이콘 */
#left-dock { position: absolute; top: 104px; left: 10px; z-index: 6; display: flex; align-items: flex-start; gap: 8px; max-height: calc(100% - 120px); pointer-events: none; }
#left-dock > * { pointer-events: auto; }
#left-dock #missions-float { position: static; max-height: calc(100vh - 300px); }
#left-dock #news-icons { position: static; }
#news-pop { margin-top: 0; }
/* 디버그 창은 지도 오른쪽(왼쪽 묶음과 겹치지 않게) */
#debug { left: auto; right: 12px; top: 104px; max-height: calc(100% - 120px); overflow: auto; z-index: 9; }
/* 함대 줄: 빈 칸 하나 */
.fleet-item.empty { flex: 0 0 auto; min-width: 150px; }
/* 작은 화면: 항구 창 사진 머리를 화면 높이에 맞춤 */
#dlg-port.has-photo .port-head { min-height: clamp(96px, 18vh, 150px); }
@media (max-height: 760px) {
  #dlg-port.has-photo .port-head h2 { font-size: 22px; }
  dialog.manage { max-height: 92vh; }
  #hud-tools button { height: 26px; font-size: 12px; }
}

/* ===== 날짜·상태 판(오른쪽 위) · 소식 오른쪽 (2026-11-08) ===== */
#hud-top { justify-content: flex-start; gap: 14px; }
#hud-fame { color: #fde68a; font-size: 13px; padding-left: 14px; border-left: 1px solid #5c4630; }
.hud-clock { position: absolute; left: auto; right: 10px; top: 4px; transform: none; display: flex; align-items: center; gap: 8px; height: 56px; padding: 4px 8px 4px 14px; background: linear-gradient(#3a2a18, #20160d); border: 2px solid #f59e0b; border-radius: 0 0 12px 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7); }
.hud-clock:not(.paused) { border-color: #22c55e; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(34, 197, 94, 0.35); }
.hud-clock.waiting { animation: paused-pulse 1.4s ease-in-out infinite; }
.hc-date { display: flex; flex-direction: column; line-height: 1.15; min-width: 128px; }
.hc-date strong { font-size: 17px; color: #fffbeb; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.hc-date small { font-size: 11px; color: #fcd34d; white-space: nowrap; }
.hud-clock:not(.paused) .hc-date small { color: #86efac; }
.hud-clock #play { width: 42px; min-width: 0; height: 42px; padding: 0; font-size: 18px; border-radius: 50%; }
.hud-clock.paused #play { background: #166534; border-color: #22c55e; color: #f0fdf4; }
.hc-speed { display: flex; flex-direction: column; gap: 2px; }
.hc-speed { flex-direction: row; }
.hc-speed button { width: 26px; height: 26px; padding: 0; font-size: 12px; }
.hc-speed button.on { background: #a16207; border-color: #fbbf24; color: #fffbeb; font-weight: 700; }
#paused-banner { display: none !important; }
/* 소식 아이콘: 지도 오른쪽 */
#news-icons { position: absolute; top: 104px; left: auto; right: 12px; z-index: 6; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@keyframes notice-in-r { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.news-icon-btn { animation-name: notice-in-r; }
/* 디버그 창은 소식 줄 왼쪽 */
#debug { right: 66px; }

/* 해적 토벌 창 */
#dlg-hunt { background: #1a1212; border: 3px double #7f1d1d; color: #f5f5f4; width: min(640px, 94vw); }
#dlg-hunt header { background: #2a1616; border-bottom: 3px solid #dc2626; }
#dlg-hunt header h2 { color: #fecaca; }
#dlg-hunt .port-section { margin-bottom: 10px; padding: 10px 12px; background: rgba(40, 20, 20, 0.85); border: 1px solid #5c2d2d; border-radius: 3px; }
#dlg-hunt .port-section h3 { color: #fca5a5; margin: 0 0 8px; }
.hunt-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #3a2020; }
.hunt-row > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.hunt-row small { color: #a8a29e; font-size: 11px; }
.hunt-row button { width: auto; padding: 0 12px; background: #7f1d1d; border-color: #dc2626; color: #fee2e2; font-weight: 700; }
.hunt-row button:disabled { background: #27272a; border-color: #3f3f46; color: #71717a; }
#news-icons { max-height: calc(100% - 130px); overflow-y: auto; overflow-x: visible; scrollbar-width: none; padding: 2px; }
#news-icons::-webkit-scrollbar { display: none; }

/* ---------- UI 검토 반영 (2026-11-09) ---------- */
#debug-toggle[hidden] { display: none; }
#monthly.short { color: #f87171; }

/* 출항 칸: 예상 순이익 */
.trip-profit { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; row-gap: 2px; margin: 4px 0 8px; padding: 8px 12px; background: #14241c; border: 1px solid #166534; border-left: 4px solid #22c55e; border-radius: 3px; }
.trip-profit.loss { background: #2a1414; border-color: #7f1d1d; border-left-color: #ef4444; }
.trip-profit .tp-label { font-size: 13px; color: #d6d3d1; }
.trip-profit b { font-size: 22px; font-weight: 800; color: #4ade80; }
.trip-profit.loss b { color: #f87171; }
.trip-profit .tp-sub { grid-column: 1 / -1; font-size: 14px; color: #e7e5e4; font-weight: 600; }
.trip-profit small { grid-column: 1 / -1; font-size: 12px; color: #a8a29e; }

/* 교역소 카드: 팔 곳 */
.tc-buyers { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; padding-top: 4px; border-top: 1px dashed #4a3a26; font-size: 12px; }
.tc-buyers .dim { color: #8a7a5e; font-size: 12px; }
.tcb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: baseline; }
.tcb-row span { color: #e7e5e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcb-row em { font-style: normal; color: #a89878; white-space: nowrap; }
.tcb-row b { min-width: 34px; text-align: right; }

/* 소식 기사: 대항해시대 소식지 한 장(15~17세기 인쇄물 느낌)
   바랜 넝마 종이, 얼룩, 이중 테두리와 모서리 장식, 목판화 범선·나침반, 장식 머리글자, 선으로 새긴 판화 그림, 밀랍 봉인 */
dialog.gazette { width: min(700px, 94vw); max-height: 94vh; padding: 0; border: none; background: transparent; overflow: visible; filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.7)); }
dialog.gazette::backdrop { background: radial-gradient(ellipse at center, rgba(20, 12, 4, 0.55), rgba(5, 3, 1, 0.82)); }
.gz-paper {
  --ink: #2b1d10; --ink-soft: #5a4128; --rule: #3a2814; --paper: #eadbb6;
  position: relative; max-height: 94vh; overflow-y: auto; padding: 16px; color: var(--ink);
  font-family: "Gowun Batang", "Batang", "바탕", serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(140, 95, 40, 0.18) 0 3%, transparent 9%),
    radial-gradient(circle at 86% 72%, rgba(140, 95, 40, 0.16) 0 2%, transparent 7%),
    radial-gradient(circle at 70% 12%, rgba(120, 80, 30, 0.10) 0 1.5%, transparent 5%),
    radial-gradient(circle at 25% 88%, rgba(120, 80, 30, 0.12) 0 2%, transparent 6%),
    radial-gradient(ellipse at 50% 45%, #f1e5c6 0%, #e6d4a8 55%, #cfb47e 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.75), inset 0 0 70px rgba(110, 70, 25, 0.45), inset 0 0 12px rgba(80, 50, 15, 0.5);
  /* 거친 종이 가장자리 */
  clip-path: polygon(0.6% 0.8%, 18% 0.2%, 36% 0.9%, 55% 0.3%, 74% 0.8%, 99.2% 0.4%, 99.7% 22%, 99.2% 48%, 99.8% 76%, 99.3% 99.4%, 80% 99.8%, 58% 99.2%, 37% 99.9%, 16% 99.3%, 0.4% 99.7%, 0.9% 74%, 0.2% 50%, 0.8% 26%);
  animation: gz-in 0.3s ease-out;
  scrollbar-width: thin; scrollbar-color: #8a6a3a transparent;
}
@keyframes gz-in { from { transform: translateY(14px) rotate(-0.8deg) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
/* 이중 테두리 + 네 모서리 꽃 장식 */
.gz-frame { position: relative; padding: 14px 22px 12px; border: 3px double var(--rule); outline: 1px solid rgba(58, 40, 20, 0.55); outline-offset: 4px; }
.gz-frame::before, .gz-frame::after { content: '✥'; position: absolute; font-size: 16px; line-height: 1; color: var(--rule); background: #e8d8b0; padding: 0 2px; }
.gz-frame::before { top: -10px; left: -10px; }
.gz-frame::after { bottom: -10px; right: -10px; }
.gz-mast { text-align: center; }
.gz-rule-top, .gz-rule-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-style: italic; color: var(--ink-soft); }
.gz-rule-top { padding-bottom: 3px; }
.gz-fleuron { font-style: normal; font-size: 15px; color: var(--rule); }
.gz-title-row { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; padding: 6px 0 2px; border-top: 1px solid var(--rule); }
.gz-cut { width: 60px; height: 54px; fill: var(--ink); stroke: var(--ink); }
.gz-rose .gz-rose-hub { fill: #e8d8b0; }
.gz-rose { width: 52px; height: 52px; justify-self: end; }
.gz-title { margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 0.22em; padding-left: 0.22em; line-height: 1.15; color: var(--ink); text-shadow: 0.6px 0.4px 0 rgba(43, 29, 16, 0.55), -0.4px 0 0 rgba(43, 29, 16, 0.3); }
.gz-motto { margin: 0 0 6px; font-size: 13px; font-style: italic; color: var(--ink-soft); letter-spacing: 0.08em; }
.gz-rule-bottom { margin-bottom: 12px; padding: 4px 2px; border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); }
.gz-kicker { margin-bottom: 4px; text-align: center; font-size: 13px; font-style: italic; letter-spacing: 0.3em; color: var(--ink-soft); }
.gz-kicker::before { content: '❧ '; font-style: normal; }
.gz-kicker::after { content: ' ☙'; font-style: normal; }
#gz-head { margin: 0 0 2px; text-align: center; font-size: 25px; font-weight: 900; line-height: 1.35; word-break: keep-all; letter-spacing: 0.02em; }
.gz-orn { text-align: center; font-size: 15px; letter-spacing: 0.6em; color: var(--ink-soft); margin-bottom: 8px; }
.gz-fig { margin: 0 0 12px; }
.gz-fig[hidden] { display: none; }
.gz-img { position: relative; overflow: hidden; border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 3px; background: #d8c494; }
/* 동판화: 흑백·높은 대비에 잉크빛, 위에 가는 빗금을 그어 새긴 선처럼 */
.gz-img img { display: block; width: 100%; height: min(260px, 28vh); object-fit: cover; filter: grayscale(1) contrast(1.75) brightness(1.08) sepia(0.6); mix-blend-mode: multiply; }
.gz-img img[hidden] { display: none; }
.gz-img::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background:
    repeating-linear-gradient(-28deg, rgba(43, 29, 16, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(70, 45, 15, 0.45) 100%); }
.gz-img canvas { display: block; width: 100%; height: min(260px, 28vh); object-fit: cover; filter: sepia(1) saturate(0.45) contrast(1.3) brightness(1.08); }
/* 사진이 있으면 해도는 오른쪽 아래 작은 판으로 */
.gz-fig.has-photo canvas { position: absolute; right: 8px; bottom: 8px; z-index: 1; width: 150px; height: 86px; border: 2px solid var(--ink); outline: 2px solid #e8d8b0; }
.gz-fig figcaption { margin-top: 7px; text-align: center; font-size: 12px; font-style: italic; color: var(--ink-soft); }
.gz-body { margin: 0; font-size: 16px; line-height: 1.85; word-break: keep-all; }
.gz-body.long { column-count: 2; column-gap: 24px; column-rule: 1px solid rgba(58, 40, 20, 0.5); }
/* 장식 머리글자: 검은 판에 종이색 글자, 안쪽 테 */
.gz-drop { float: left; width: 2.2em; height: 2.2em; margin: 5px 10px 0 0; display: grid; place-items: center; font-size: 26px; font-weight: 900; line-height: 1;
  color: #efe2bf; background: radial-gradient(circle at 30% 30%, #4a3218, #22160a); border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 2px;
  box-shadow: inset 0 0 0 3px #22160a, inset 0 0 0 4px rgba(239, 226, 191, 0.55); }
.gz-dateline { font-weight: 700; color: var(--ink); }
.gz-end { clear: both; text-align: center; font-size: 18px; color: var(--ink-soft); margin: 6px 0 4px; }
.gz-acts { display: flex; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px solid var(--rule); }
.gz-acts .gz-gap { flex: 1; }
/* 손가락 기호(☜ ☞): 당시 인쇄물의 가리킴표 */
.gz-paper .gz-hand { width: auto; height: 34px; padding: 0 8px; font-size: 26px; line-height: 1; color: var(--ink); background: transparent; border: none; box-shadow: none; font-family: "Segoe UI Symbol", serif; }
.gz-paper .gz-hand:hover:not(:disabled) { background: rgba(58, 40, 20, 0.12); color: #000; }
.gz-paper .gz-hand:disabled { opacity: 0.25; background: transparent; }
.gz-paper .gz-text-btn { width: auto; height: 32px; padding: 0 12px; font-family: inherit; font-size: 14px; font-style: italic; color: var(--ink); background: transparent; border: none; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.gz-paper .gz-text-btn:hover:not(:disabled) { background: rgba(58, 40, 20, 0.1); }
/* 붉은 밀랍 봉인 */
.gz-paper .gz-seal { width: 58px; height: 58px; padding: 0; border-radius: 50%; font-family: inherit; font-size: 14px; font-weight: 900; color: #f6d9c4; letter-spacing: 0.1em;
  background: radial-gradient(circle at 35% 30%, #c0392b 0%, #8e1b14 55%, #5c0d09 100%); border: none;
  box-shadow: 0 0 0 3px #7a1610, 0 0 0 5px rgba(122, 22, 16, 0.35), inset 0 2px 3px rgba(255, 200, 180, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.45), 0 3px 6px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 #3a0705; transform: rotate(-8deg); }
.gz-paper .gz-seal:hover:not(:disabled) { background: radial-gradient(circle at 35% 30%, #d44a3a 0%, #9e2219 55%, #6a120c 100%); transform: rotate(-8deg) scale(1.05); }
.gz-paper .gz-seal:active:not(:disabled) { transform: rotate(-8deg) scale(0.96); }
@media (max-height: 760px) {
  .gz-title { font-size: 32px; }
  .gz-cut { width: 46px; height: 42px; }
  #gz-head { font-size: 21px; }
  .gz-motto { display: none; }
}


/* ==========================================================================
   창 통일 테마 (2026-11-09): 선장실 — 짙은 나무 판 + 놋쇠·금 테
   모든 창이 같은 틀을 쓰고, 창 종류는 머리 아이콘과 머리 아래 색 띠로만 구분한다.
   ========================================================================== */
:root {
  --wd-0: #120c07; --wd-1: #1c140c; --wd-2: #261b11; --wd-3: #312316; --wd-4: #3e2d1c;
  --ln: #4f3b26; --ln-hi: #7d6038; --brass: #b8893f; --gold: #e6bc62; --gold-hi: #f7d98f;
  --ink: #f4e6c8; --ink-dim: #c2ad86; --ink-faint: #8f7c5c;
}
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(230, 188, 98, 0.07), transparent 60%),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wd-2), var(--wd-1));
  color: var(--ink);
  border: 2px solid var(--brass);
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 0 0 5px var(--wd-3), 0 0 0 6px var(--ln-hi), 0 24px 70px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(0, 0, 0, 0.45);
}
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage::backdrop { background: radial-gradient(ellipse at center, rgba(10, 6, 2, 0.45), rgba(5, 3, 1, 0.78)); }
/* 머리: 놋쇠 이름판 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage > header {
  position: relative;
  padding: 10px 16px;
  background: linear-gradient(180deg, #4a3520 0%, #33241a 55%, #261a10 100%);
  border-bottom: 2px solid var(--brass);
  box-shadow: inset 0 1px 0 rgba(247, 217, 143, 0.25), 0 3px 8px rgba(0, 0, 0, 0.5);
}
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage > header::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -6px; height: 1px; background: linear-gradient(90deg, transparent, var(--ln-hi), transparent); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage > header h2 { color: var(--gold-hi); font-size: 19px; letter-spacing: 0.04em; text-shadow: 0 1px 0 #000, 0 0 12px rgba(230, 188, 98, 0.25); }
#dlg-fleet.manage > header { border-bottom: 3px solid var(--fleet, var(--brass)); }
#dlg-rival.manage > header { border-bottom: 3px solid var(--rival, var(--brass)); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dialog-body { background: transparent; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dialog-body::-webkit-scrollbar { width: 10px; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dialog-body::-webkit-scrollbar-thumb { background: var(--ln-hi); border: 2px solid var(--wd-1); border-radius: 5px; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dialog-body::-webkit-scrollbar-track { background: var(--wd-0); }
/* 칸(섹션): 가죽 판 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-section, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-panel {
  margin-bottom: 10px; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(49, 35, 22, 0.92), rgba(38, 27, 17, 0.92));
  border: 1px solid var(--ln); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(247, 217, 143, 0.07), 0 2px 4px rgba(0, 0, 0, 0.35);
}
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-section h3, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-panel h3, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage h3 { color: var(--gold); letter-spacing: 0.02em; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-section > h3 { display: flex; align-items: center; gap: 8px; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-section > h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ln-hi), transparent); }
/* 사진 창은 사진이 비치도록 반투명 */
#dlg-port.has-photo.manage .port-section { background: linear-gradient(180deg, rgba(38, 27, 17, 0.86), rgba(28, 20, 12, 0.88)); backdrop-filter: blur(3px); }
#dlg-port.has-photo.manage { background: linear-gradient(rgba(18, 12, 7, 0.55), rgba(18, 12, 7, 0.8)), var(--port-photo) center / cover local, var(--wd-1); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-section.loot-sec { background: rgba(59, 24, 20, 0.9); border-color: #7f1d1d; }
/* 카드 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .trade-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .quote-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .ship-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dock-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dev-perks div, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .yard-lock,
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .book-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-run, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-stat, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-ship, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .rep-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .ch-card, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .ach, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .slot-row {
  background: linear-gradient(180deg, rgba(30, 21, 13, 0.95), rgba(22, 15, 9, 0.95));
  border-color: var(--ln);
}
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .trade-card:hover, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-card:hover, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-ship:hover { border-color: var(--ln-hi); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .trade-step { background: rgba(62, 45, 28, 0.9); border-color: var(--ln-hi); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-card { background: linear-gradient(180deg, rgba(74, 53, 32, 0.9) 0%, rgba(30, 21, 13, 0.92) 75%); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-head { background-color: var(--wd-3); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-pic { background: radial-gradient(#4a3520, #1c140c); border-color: var(--ln); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-card-pic { background-color: var(--wd-4); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-run-port { background: var(--wd-4); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-badge, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .tier-2 { background: #4a3520; color: var(--gold-hi); }
/* 막대 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .stat-bar, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-run-bar, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dev-bar { background: var(--wd-0); border-color: var(--ln); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-bar { background: var(--wd-0); border-color: var(--ln); }
/* 글자 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-line.dim, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .tc-note, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .tc-stock small, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .tc-row span, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .ship-stats span:first-child,
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-facts span, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dev-perks span, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dev-node small, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-run-top span, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-card small, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-card.add small,
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .book-card small, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .book-col small, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .dim { color: var(--ink-dim); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-sub { color: var(--ink-dim); }
#dlg-port.has-photo.manage .port-sub { background: rgba(18, 12, 7, 0.85); }
/* 탭: 놋쇠 책갈피 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-tabs, #dlg-port.has-photo.manage .port-tabs { background: linear-gradient(180deg, rgba(28, 20, 12, 0.97), rgba(22, 15, 9, 0.97)); border-bottom: 2px solid var(--brass); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-tab { background: linear-gradient(180deg, #33241a, #261a10); border: 1px solid var(--ln); border-bottom: 0; color: var(--ink-dim); box-shadow: inset 0 1px 0 rgba(247, 217, 143, 0.1); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-tab:hover:not(:disabled) { color: var(--ink); border-color: var(--ln-hi); background: linear-gradient(180deg, #43301f, #2e2014); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-tab.on { background: linear-gradient(180deg, #8a6424, #5e4317); border-color: var(--gold); color: #fff6dc; text-shadow: 0 1px 0 #000; box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.35), 0 -2px 8px rgba(230, 188, 98, 0.25); }
/* 표 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-table th { background: transparent; color: var(--gold); font-weight: 700; border-bottom: 1px solid var(--ln-hi); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-table td { border-color: var(--ln); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-table tbody tr:nth-child(even) td { background: rgba(255, 235, 190, 0.025); }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .repair-row, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .fm-repair { border-color: var(--ln); }
/* 입력 */
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage input[type="text"], :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage input[type="number"], :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage select, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .route-buy input, :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage .port-qty input { background: var(--wd-0); border: 1px solid var(--ln-hi); color: var(--ink); }

/* ---------- 장부 ---------- */
.book-hero { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 12px; margin-bottom: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, rgba(110, 80, 30, 0.35), rgba(30, 21, 13, 0.9) 60%); border: 1px solid var(--brass); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(247, 217, 143, 0.2), 0 3px 10px rgba(0, 0, 0, 0.4); }
.bh-main { display: flex; flex-direction: column; justify-content: center; }
.bh-main span { font-size: 13px; color: var(--ink-dim); }
.bh-main strong { font-size: 30px; font-weight: 800; color: var(--gold-hi); text-shadow: 0 2px 0 #000, 0 0 14px rgba(230, 188, 98, 0.3); }
.bh-main small { font-size: 12px; color: var(--ink-faint); }
.bh-parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bh-part { display: grid; grid-template-rows: auto auto; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 8px 10px; background: rgba(18, 12, 7, 0.6); border: 1px solid var(--ln); border-radius: 3px; }
.bh-part i { grid-row: 1 / 3; font-style: normal; font-size: 22px; }
.bh-part span { font-size: 12px; color: var(--ink-dim); }
.bh-part b { font-size: 16px; color: var(--ink); }
.book-card strong.pending { color: #fbbf24; }
.book-groups td, .book-groups th { padding-left: 6px; }
.book-groups td.zero { color: var(--ink-faint); }
.bg-row { cursor: pointer; }
.bg-row:hover td { background: rgba(230, 188, 98, 0.08) !important; }
.bg-row.open td { background: rgba(230, 188, 98, 0.12) !important; }
.bg-caret { display: inline-block; width: 14px; color: var(--gold); }
.bg-detail td { padding: 8px 10px 10px 20px !important; text-align: left !important; background: rgba(18, 12, 7, 0.6) !important; }
.bg-group { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 3px 0; font-size: 13px; }
.bg-group b { min-width: 56px; color: var(--gold); }
.bg-group span { color: var(--ink-dim); }
.bg-group em { font-style: normal; font-weight: 700; }
@media (max-width: 1100px) { .book-hero { grid-template-columns: 1fr; } .bh-parts { grid-template-columns: repeat(2, 1fr); } }
.book-groups tr.bg-detail td:first-child { display: table-cell; white-space: normal; }
.book-groups th:last-child, .book-groups td:last-child { text-align: right; padding-left: 12px; }
.book-groups th { padding-right: 6px; }
:is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year).manage code { padding: 0 5px; background: #4a3520; border: 1px solid var(--ln-hi); border-radius: 2px; color: var(--gold-hi); font-family: inherit; }
#dlg-ledger .book-table th:last-child, #dlg-ledger .book-table td:last-child { text-align: right; padding-left: 12px; }

/* 소식지 글꼴 섞기: 제호는 옛 활자체(송명), 제목은 굵은 명조, 본문은 고운바탕, 작은 글은 나눔명조, 함대 편지는 손글씨 */
.gz-title { font-family: "Song Myung", "Batang", serif; font-weight: 400; font-size: 46px; }
#gz-head { font-family: "Nanum Myeongjo", "Batang", serif; font-weight: 800; }
.gz-motto, .gz-kicker, .gz-rule-top, .gz-rule-bottom, .gz-fig figcaption { font-family: "Nanum Myeongjo", "Batang", serif; }
.gz-body { font-family: "Gowun Batang", "Batang", serif; }
.gz-dateline { font-family: "Gowun Batang", "Batang", serif; font-style: normal; font-weight: 700; }
.gz-body.letter > span:last-child { font-family: "Nanum Pen Script", "Batang", cursive; font-size: 24px; line-height: 1.5; color: #22180c; }
.gz-paper .gz-text-btn { font-family: "Nanum Myeongjo", "Batang", serif; }
/* 발신지 항구 링크: 잉크색 밑줄, 누르면 지도에서 그 항구로 */
.gz-port-link { color: #6b1d0f; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.gz-port-link:hover { color: #9a2a14; text-decoration-thickness: 2px; }
.gz-port-link:focus-visible { outline: 2px solid #9a2a14; outline-offset: 2px; }
@media (max-height: 760px) { .gz-title { font-size: 36px; } }

/* 거래 우선권(항구 탭), 교역소 배지, 연말 결산 */
.prio-badge { margin-left: 4px; padding: 0 5px; font-size: 11px; font-weight: 700; color: #fde68a; background: #5e4317; border: 1px solid var(--gold, #e6bc62); border-radius: 8px; }
.inf-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.inf-head b { font-size: 15px; color: var(--ink, #f4e6c8); }
.inf-head.mine b { color: var(--gold-hi, #f7d98f); }
.inf-head small { font-size: 12px; color: var(--ink-dim, #c2ad86); }
.inf-bar { display: flex; height: 12px; margin-bottom: 6px; overflow: hidden; background: var(--wd-0, #120c07); border: 1px solid var(--ln, #4f3b26); border-radius: 2px; }
.inf-bar i { display: block; height: 100%; border-right: 1px solid rgba(0, 0, 0, 0.5); }
.inf-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; font-size: 13px; }
.inf-row { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 8px; align-items: center; }
.inf-row i { width: 10px; height: 10px; border-radius: 2px; }
.inf-row em { font-style: normal; color: var(--ink-dim, #c2ad86); }
.inf-row b { text-align: right; }
.inf-row.me span, .inf-row.me b { color: var(--gold-hi, #f7d98f); font-weight: 700; }
.year-hero { display: grid; grid-template-columns: 160px 1fr; gap: 12px; margin-bottom: 10px; padding: 14px; background: linear-gradient(135deg, rgba(110, 80, 30, 0.4), rgba(30, 21, 13, 0.9) 60%); border: 1px solid var(--brass, #b8893f); border-radius: 4px; }
.yh-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--ln-hi, #7d6038); }
.yh-rank small, .yh-rank span { font-size: 12px; color: var(--ink-dim, #c2ad86); }
.yh-rank strong { font-size: 44px; line-height: 1.1; color: var(--gold-hi, #f7d98f); text-shadow: 0 2px 0 #000, 0 0 16px rgba(230, 188, 98, 0.35); }
.yh-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.yh-stats div { display: flex; flex-direction: column; padding: 6px 10px; background: rgba(18, 12, 7, 0.6); border: 1px solid var(--ln, #4f3b26); border-radius: 3px; }
.yh-stats span { font-size: 12px; color: var(--ink-dim, #c2ad86); }
.yh-stats b { font-size: 17px; }
.year-table .swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }
#dlg-year .book-table th:last-child, #dlg-year .book-table td:last-child { text-align: right; }
.book-year-btn { margin: 0 0 10px; height: 30px; padding: 0 14px; }
.year-table th:nth-child(2), .year-table td:nth-child(2) { text-align: left; padding-left: 8px; }

/* 2026-11-09 피드백: 소식지 버튼은 수수한 인쇄물풍, 은화 아래 이번 달 수익 색, 빌리기는 메뉴 줄 */
.gz-paper .gz-btn { width: auto; height: 32px; padding: 0 16px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 14px; font-weight: 700; color: var(--ink); background: rgba(255, 248, 228, 0.55); border: 1px solid var(--ink); border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(234, 219, 182, 0.9), inset 0 0 0 3px rgba(43, 29, 16, 0.35); }
.gz-paper .gz-btn:hover:not(:disabled) { background: rgba(255, 248, 228, 0.9); }
.gz-paper .gz-btn-main { color: #f4e6c8; background: #3a2814; box-shadow: inset 0 0 0 2px #3a2814, inset 0 0 0 3px rgba(244, 230, 200, 0.45); }
.gz-paper .gz-btn-main:hover:not(:disabled) { background: #523a1e; }
#monthly.gain { color: #4ade80; }
#monthly.loss { color: #f87171; }
/* 임무 창을 메뉴 버튼 줄과 같은 높이로. 화면이 좁아 겹치면 메뉴 줄을 임무 창 오른쪽에서 시작한다. */
#left-dock { top: 58px; }
@media (max-width: 1540px) { #hud-tools { margin-left: 312px; margin-right: auto; } }

/* 정기 항로: 지역 자동 지역 고르기 */
.route-regions { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; margin: 4px 0; }
.route-regions button { height: 28px; padding: 0 10px; font-size: 12px; }
#route-stops[hidden] { display: none; }

/* ==========================================================================
   모바일·작은 화면 (2026-11-09): 폭 900px 이하 또는 높이 520px 이하(가로 휴대폰)
   ========================================================================== */
#zoom-ctrl, #panel-toggle, #panel-close { display: none; }
#map { touch-action: none; }
button { touch-action: manipulation; }
@media (max-width: 900px), (max-height: 520px) {
  html, body { overscroll-behavior: none; }
  /* 오른쪽 정보 판: 오른쪽에서 밀려 나오는 덮개 */
  #panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(340px, 88vw); transform: translateX(100%); transition: transform 0.2s ease; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6); }
  body.panel-open #panel { transform: none; }
  #hud-tools #panel-toggle { display: inline-flex; }
  body.panel-open #panel-toggle { border-color: var(--gold, #e6bc62); }
  #panel-close { display: block; width: calc(100% - 24px); margin: 10px 12px 0; height: 36px; }
  /* 위 HUD: 줄바꿈해 두 줄로, 작은 글은 숨김 */
  #hud-top { height: auto; min-height: 44px; flex-wrap: wrap; gap: 4px 10px; padding: 4px 8px; }
  .hud-left { gap: 8px; }
  .hud-mark { padding-right: 8px; gap: 6px; }
  .hud-mark small, #hud-fame, #clock-status { display: none; }
  #company-flag { width: 24px; height: 24px; font-size: 14px; }
  .hud-mark strong { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .hud-gold strong { font-size: 15px; }
  .hud-coin { width: 18px; height: 18px; }
  .hud-clock { position: static; margin-left: auto; height: 40px; padding: 2px 4px 2px 8px; gap: 4px; border-radius: 8px; }
  .hud-clock strong { font-size: 13px; }
  .hud-clock #play { height: 34px; min-width: 44px; }
  .hc-speed button { width: 30px; height: 30px; padding: 0; }
  /* 메뉴 버튼 줄: 화면 폭 전체, 옆으로 밀어 보기 */
  #hud-tools { width: 100%; max-width: 100%; margin: 0 !important; border-radius: 0; border-left: none; border-right: none; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  #hud-tools::-webkit-scrollbar { display: none; }
  #hud-tools button { flex: none; height: 34px; white-space: nowrap; }
  /* 임무 창(처음엔 접힘), 소식 아이콘 */
  #left-dock { top: 100px; left: 6px; max-height: calc(100% - 170px); }
  #missions-float { width: min(270px, 72vw); }
  #left-dock #missions-float { max-height: calc(100dvh - 240px); }
  #news-icons { top: 100px; right: 6px; max-height: calc(100% - 230px); }
  .news-icon-btn { width: 40px; height: 40px; font-size: 18px; }
  /* 아래 함대 줄 */
  #fleet-bar { padding: 4px 6px; gap: 6px; overflow-x: auto; }
  #fleet-bar > h2 { display: none; }
  /* 확대·축소 버튼 */
  #zoom-ctrl { display: flex; flex-direction: column; gap: 8px; position: absolute; right: 8px; bottom: 12px; z-index: 6; }
  #zoom-ctrl button { width: 46px; height: 46px; padding: 0; font-size: 24px; border-radius: 50%; }
  /* 메뉴 화면 */
  .menu-panel, .menu-wide { width: min(520px, 94vw); max-height: 94dvh; overflow-y: auto; padding: 18px 16px; }
  /* 창: 화면 전체 */
  :is(#dlg-port, #dlg-fleet, #dlg-route, #dlg-help, #dlg-ledger, #dlg-loan, #dlg-rival, #dlg-hunt, #dlg-newfleet, #dlg-year) { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .dialog-body { padding: 10px; overflow-x: auto; }
  .port-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .port-tab { flex: none; }
  .book-cards, .year-hero, .book-hero { grid-template-columns: 1fr; }
  .bh-parts, .yh-stats { grid-template-columns: repeat(2, 1fr); }
  .yh-rank { border-right: none; border-bottom: 1px solid var(--ln-hi, #7d6038); padding-bottom: 6px; }
  .fleet-body, .nf-body { flex-direction: column; }
  .nf-body { overflow-y: auto !important; }
  /* 소식지 */
  dialog.gazette { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: 0 auto; }
  .gz-paper { max-height: 100dvh; padding: 8px; clip-path: none; }
  .gz-frame { padding: 10px 12px; }
  .gz-cut { display: none; }
  .gz-title-row { grid-template-columns: 1fr; }
  .gz-title { font-size: 30px; }
  #gz-head { font-size: 19px; }
  .gz-body { font-size: 15px; }
  .gz-body.long { column-count: 1; }
  .gz-fig.has-photo canvas { width: 110px; height: 64px; }
}
/* 가로 휴대폰(높이가 낮음): HUD는 한 줄, 창 머리 사진은 낮게 */
@media (max-height: 520px) {
  #hud-top { flex-wrap: nowrap; }
  #left-dock, #news-icons { top: 84px; }
  #dlg-port.has-photo .port-head { min-height: 64px; }
  .gz-img img, .gz-img canvas { height: 38vh; }
}
@media (max-width: 900px), (max-height: 520px) {
  #left-dock, #news-icons { top: calc(var(--hud-h, 96px) + 6px); }
  #left-dock { max-height: calc(100% - var(--hud-h, 96px) - 70px); }
  #news-icons { max-height: calc(100% - var(--hud-h, 96px) - 130px); }
  #hud-tools #panel-toggle { display: inline-block; }
  #fleets .fleet-item { flex: 0 0 auto; min-width: 150px; }
}
@media (max-width: 900px), (max-height: 520px) {
  #fleets { display: flex; overflow-x: auto; scrollbar-width: none; }
}
/* 가로 휴대폰: 함대 카드는 이름·상태 한 줄씩만(화물 막대·적재는 숨김) */
@media (max-height: 520px) {
  #fleets .fleet-item { padding: 3px 8px; min-width: 170px; }
  #fleets .fleet-item .fleet-bar, #fleets .fleet-item .fleet-load { display: none; }
  #fleets .fleet-item.empty small { display: none; }
}
