/* Sea of Hex — dark nautical theme. Self-contained: system fonts only. */

:root {
  --bg: #0a1220;
  --panel: #121d2c;
  --panel-2: #172436;
  --border: #24354a;
  --text: #cfd8e3;
  --muted: #7f93a8;
  --gold: #d8a13f;
  --good: #59b559;
  --bad: #e0684b;
  --warn: #d8c13f;
  --sea: #14324f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif;
}

button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: #2b4a2b; border-color: #3f6b3f; }
button.danger { background: #4a2723; border-color: #7a4038; }
button.active { border-color: var(--gold); background: #33405a; box-shadow: 0 0 0 1px var(--gold) inset; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #0e1826;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
}
input.qty { width: 3.4em; }
input.cfg { width: 6em; }
input.cfg.wide { width: 10em; }

h3, h4 { margin: 10px 0 4px; color: var(--gold); font-weight: 600; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.grow { flex: 1; min-width: 0; }
.self-center { align-self: center; }
.row { display: flex; align-items: baseline; }
.row.spread { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 8px; }
.gap-s { gap: 4px; }
.hidden { display: none !important; }

/* ------------------------------------------------------------- layout */

#app { display: flex; height: 100vh; }

#mapwrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#map { display: block; cursor: crosshair; }

#map-toolbar {
  position: absolute;
  /* Centre in the gap between the ship board (bottom-left, ~370px) and the log
     box (bottom-right, ~410px), so the bar clears both. */
  bottom: 14px; left: calc(50% - 20px);
  transform: translateX(-50%);
  max-width: calc(100% - 810px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
  background: rgba(13, 21, 33, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
#route-info { font-size: 12px; color: var(--muted); max-width: 320px; }
#route-info.over { color: var(--bad); }

#conn-badge {
  position: absolute;
  bottom: 8px; left: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(13, 21, 33, 0.85);
  border: 1px solid var(--border);
}
.conn-connected { color: var(--good); }
.conn-connecting, .conn-disconnected { color: var(--warn); }

#map-tooltip {
  position: absolute;
  pointer-events: none;
  max-width: 260px;
  background: rgba(10, 16, 26, 0.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  z-index: 20;
}

#side {
  width: 390px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

/* Log: a compact box docked bottom-right over the map, mirroring the ship
   board on the bottom-left (2026-07-22). The map fills the width the old log
   column used to take. */
#panel-log {
  position: absolute; right: 10px; bottom: 10px; width: 400px;
  max-height: 240px; display: flex; flex-direction: column; z-index: 7;
  background: rgba(13, 19, 26, 0.94); border: 1px solid #2d4356; border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
#panel-log .panel-body#log-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head-actions { display: flex; gap: 6px; align-items: center; }
.log-filter-btn { font-size: 11px; padding: 1px 8px; line-height: 1.4; }

/* ------------------------------------------------------------- panels */

.panel { border-bottom: 1px solid var(--border); }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--panel-2);
  font-weight: 600;
  color: var(--gold);
  position: sticky;
  top: 0;
  z-index: 5;
}
.collapse-btn { padding: 0 8px; line-height: 1.2; }
.panel-body { padding: 8px 10px; }
.panel-body.collapsed { display: none; }
.panel-body > * + * { margin-top: 5px; }

.chip {
  border: 1px solid;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.chip.ended { opacity: 0.45; text-decoration: line-through; }
.chip.active { background: #223550; box-shadow: 0 0 5px rgba(216, 161, 63, 0.5); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.conn-dot.on { background: var(--good); }
.conn-dot.off { background: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

.wind-arrow {
  display: inline-block;
  color: var(--gold);
  font-size: 16px;
  transition: transform 0.4s;
}

.event-track { display: inline-flex; gap: 2px; }
.track-cell {
  width: 17px; height: 17px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.track-cell.past { background: #2c3c55; }
.track-cell.here { background: var(--gold); color: #0b0f16; font-weight: 700; }

.pips { display: inline-flex; gap: 2px; align-self: center; }
.pip { width: 9px; height: 9px; border-radius: 2px; border: 1px solid var(--border); }
.pips.hull .pip.filled { background: var(--bad); }
.pips.water .pip.filled { background: #3f9bd8; }
.pips.wanted .pip.filled { background: var(--warn); }

/* market */
.market-row { display: flex; gap: 8px; align-items: baseline; }
.market-row.contraband { border-left: 3px solid #cf5b4e; padding-left: 5px; margin-left: -8px; }
.market-row .price { min-width: 2em; text-align: right; color: var(--gold); }
.delta { min-width: 2.4em; font-size: 12px; color: var(--muted); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ship */
#ship-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 6px; }
.tab {
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
  padding: 3px 8px;
}
.tab.on { background: var(--panel-2); border-bottom-width: 3px; }
#ship-body > * + * { margin-top: 5px; }

.slot-row { display: flex; flex-wrap: wrap; gap: 4px; }
.slot {
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--muted);
}
.slot.filled { border-style: solid; color: var(--text); background: var(--panel-2); }
.loaded-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  margin-left: 4px;
}
.loaded-dot.on { background: var(--bad); border-color: var(--bad); }

.cargo-cell.ssu { background: #35502e; }
.cargo-cell.good { background: #4d3c22; }
.cargo-cell.empty { opacity: 0.4; }
.cargo-cell.overflow { border-color: var(--bad); box-shadow: 0 0 4px var(--bad); }

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-2);
  padding: 0 5px;
  margin: 1px 2px;
  font-size: 11px;
}
.tag.bad { border-color: #7a4038; color: var(--bad); }
.tag.good { border-color: #3f6b3f; color: var(--good); }
.pair-chip { cursor: pointer; }

.crew-row { display: flex; flex-wrap: wrap; gap: 5px; }
.crew-card {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  padding: 4px 7px;
  min-width: 108px;
  font-size: 12px;
}
.crew-card.exhausted { opacity: 0.5; filter: grayscale(0.8); }
.crew-card.buyable { cursor: pointer; }
.crew-card.buyable:hover { border-color: var(--gold); }
.crew-card.locked { opacity: 0.55; }
.crew-card.paired { outline: 2px solid var(--good); }
.crew-card.selected { outline: 2px solid var(--gold); }
.crew-name { font-weight: 600; }
.crew-stats { color: var(--muted); }
.crew-weapon { color: var(--warn); font-size: 11px; }

/* shops */
.shop-row { display: flex; gap: 6px; align-items: center; }
.shop-row + .shop-row { margin-top: 3px; }
.cfg-row { display: flex; gap: 6px; align-items: center; }
.cfg-row + .cfg-row { margin-top: 2px; }

/* combat */
.hand-row { display: flex; flex-wrap: wrap; gap: 5px; }
.hand-card {
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: #2a2417;
  padding: 8px 8px;
  min-width: 66px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
}
.hand-card:hover:not(.locked) { background: #3a3220; transform: translateY(-2px); }
.hand-card.locked { cursor: not-allowed; opacity: 0.55; border-color: var(--border); }
.hand-card.selected { background: #4a3d1c; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); transform: translateY(-2px); }

/* log */
#log-body {
  flex: 1;
  min-height: 110px;
  overflow-y: auto;
  background: #0d1725;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px;
}
.log-line + .log-line { margin-top: 1px; }
.log-line.manual { color: var(--warn); }
.log-who { font-weight: 600; }
#dice-row { display: flex; gap: 4px; margin-top: 5px; }
.die-btn { flex: 1; font-size: 12px; padding: 3px 0; }
#chat-form { display: flex; gap: 5px; margin-top: 5px; }
#chat-input { flex: 1; }

/* screens (title / lobby / setup) */
.screen {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 18, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  overflow-y: auto;
  padding: 20px;
}

.title-screen {
  padding: 0;
  overflow: hidden;
  background: #03070b;
  z-index: 80;
}
.title-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
}
.title-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 55%, rgba(1, 5, 9, 0.78) 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.18), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}
.title-menu {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(24px, 5.5vh, 64px);
  transform: translateX(-50%);
  width: min(920px, calc(100% - 40px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.title-mode {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 11px 18px;
  border: 2px solid #b78235;
  border-radius: 8px;
  color: #f4dfae;
  background: linear-gradient(180deg, rgba(31, 27, 23, 0.95), rgba(10, 14, 18, 0.96));
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(175, 111, 30, 0.12);
  text-shadow: 0 2px 2px #000;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.title-mode:hover:not(:disabled), .title-mode:focus-visible {
  transform: translateY(-3px);
  border-color: #f1c76c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 18px rgba(216, 161, 63, 0.32);
  outline: none;
}
.title-mode strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 2vw, 25px);
  letter-spacing: 0.04em;
}
.title-mode span {
  margin-top: 2px;
  color: #c6b895;
  font-size: 12px;
}
.title-audio {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(216, 161, 63, 0.5);
  border-radius: 6px;
  color: #d7c8a4;
  background: rgba(4, 8, 13, 0.78);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  font-size: 12px;
}
#btn-menu-music { min-width: 104px; }

.screen-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 26px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
}
.screen-card.wide { max-width: 860px; }
.screen-card h1 { margin: 0; color: var(--gold); letter-spacing: 0.04em; }
.subtitle { margin-top: 2px; color: var(--muted); }
.lobby-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lobby-mode-summary {
  margin: 12px 0 0;
  padding: 7px 9px;
  border-left: 3px solid var(--gold);
  background: rgba(216, 161, 63, 0.08);
  color: var(--text);
}
#lobby-join-row { display: flex; gap: 6px; margin: 14px 0; }
#lobby-name { flex: 1; }
#lobby-status { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.lobby-player { padding: 2px 0; display: flex; align-items: center; gap: 4px; }
#lobby-actions { display: flex; gap: 8px; margin-top: 14px; }
.setup-poe { color: var(--gold); font-weight: 600; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.pick-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 7px 9px;
  cursor: pointer;
}
.pick-card:hover { border-color: var(--gold); }
.pick-card.picked { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.pick-card.taken { opacity: 0.4; cursor: not-allowed; }

/* modals */
#modal-root { position: fixed; inset: 0; z-index: 60; }
#modal-root.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 18px 22px;
  max-width: 440px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.modal.wide { max-width: 720px; }
.modal > * + * { margin-top: 8px; }
.branches .branch { padding: 2px 6px; border-radius: 4px; }
.branch.active { background: #2b4a2b; }
.branch-range { color: var(--gold); display: inline-block; min-width: 3.4em; }
.roll-big { font-size: 26px; color: var(--gold); text-align: center; }
.board-cols { display: flex; gap: 14px; }
.board-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }

/* toasts */
#toast-root {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 8px 14px;
  max-width: 480px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.toast.error { border-left-color: var(--bad); }

@media (max-width: 1280px) {
  #side { width: 330px; }
  #panel-log { width: 320px; }
}

@media (max-width: 720px), (max-height: 620px) {
  .title-menu {
    bottom: 16px;
    width: min(430px, calc(100% - 24px));
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .title-mode { min-height: 52px; padding: 6px 12px; }
  .title-mode strong { font-size: 18px; }
  .title-mode span { font-size: 11px; }
  .title-audio { top: 8px; right: 8px; }
  .title-audio span { display: none; }
}

/* tiny inline action buttons (lobby seat removal) */
button.mini { padding: 0 6px; font-size: 11px; line-height: 18px; margin-left: 6px; }

/* SSU quarter-squares: supply units drawn inside a cargo slot, 4 per slot */
.cargo-cell.ssu { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 2px; }
.ssu-mini { border-radius: 1px; background: #24361f; }
.ssu-mini.filled {
  background: #7fae6a url('/assets/goods/ssu.png') center / contain no-repeat;
}

/* setup screen PoE banner — the number players watch while outfitting */
.setup-poe-banner { position: sticky; top: 0; z-index: 5; display: flex; align-items: baseline; gap: 10px;
  background: var(--panel, #16222b); border: 1px solid var(--gold); border-radius: 6px; padding: 6px 12px; margin: 6px 0; }
.setup-poe-big { color: var(--gold); font-size: 26px; font-weight: 700; }
.setup-poe-ssu { margin-left: auto; color: var(--fg-muted, #9ab); }

/* Ship board: docked bottom-left over the map (design ruling 2026-07-20) —
   outfit slots, cargo, damage tracks, and MP chits live here. */
#panel-ship { position: absolute; left: 10px; bottom: 10px; width: 360px;
  max-height: 52%; display: flex; flex-direction: column; z-index: 7;
  background: rgba(13, 19, 26, 0.94); border: 1px solid #2d4356; border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5); }
#panel-ship .panel-body { overflow-y: auto; }
.mp-chips { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.mp-chip { width: 13px; height: 13px; border-radius: 50%; background: var(--gold);
  border: 1px solid #7a6420; box-shadow: inset 0 -2px 3px rgba(0,0,0,0.35); }
.track-pip { width: 11px; height: 11px; border-radius: 2px; border: 1px solid #46617a; }
.track-pip.filled { background: #cf5b4e; border-color: #cf5b4e; }

/* The ship board is a side-profile SVG ship (masts + deck cannons + hold). */
.ship-svg-wrap { position: relative; margin: 6px 0; }
.ship-svg-wrap svg { width: 100%; height: auto; display: block; }
/* Cap and centre the ship board when it appears inside the wide setup card. */
.setup-shipboard { max-width: 420px; margin: 4px 0 10px; }
/* resource icons (extracted from the goods sheet) */
.good-icon { border-radius: 4px; vertical-align: middle; align-self: center; }
/* Contraband is flagged in red everywhere goods appear (2026-07-22). */
.good-icon.contraband { border: 2px solid #cf5b4e; box-shadow: 0 0 0 1px #cf5b4e55; box-sizing: border-box; }
.contraband-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #e0796c; border: 1px solid #cf5b4e; border-radius: 8px; padding: 0 5px; line-height: 1.5; }
/* Unified hold overlay: every occupant and cargo interaction lives in the
   physical grid inside the ship graphic. */
.ship-hold-grid { position: absolute; display: grid; z-index: 2; }
.hold-tile { width: 30px; height: 30px; border-radius: 5px; border: 1px solid #8a6a40; background: #4d3c22;
  display: flex; align-items: center; justify-content: center; position: relative; font-size: 14px; }
.hold-tile.ship-hold-cell { width: auto; height: auto; min-width: 0; aspect-ratio: 1; box-sizing: border-box;
  overflow: visible; font-size: clamp(10px, 3.8vw, 18px); }
.ship-hold-cell.damage { background: #4a221c; color: #e0796c; border-color: #a04a3e; font-weight: 700; }
.ship-hold-cell.water { background: #1d4463; color: #7fb8e0; border-color: #2d6a94; font-weight: 700; }
.ship-hold-cell.cabin { background: #3a3350; border-color: #6a5f90; }
.ship-hold-cell.ssu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: stretch;
  justify-items: stretch;
  gap: 1px;
  padding: 3px;
  background: #28361f;
  border-color: #4e6a3d;
}
.ship-hold-cell.outfit { background: #263846; border-color: #66869d; }
.ship-hold-cell.gear { background: #342f27; border-color: #8a7655; }
.ship-hold-cell.curse { background: #3d223b; border-color: #a45c9e; color: #d991d3; }
.ship-hold-cell.overflow { border-color: #cf5b4e !important; box-shadow: 0 0 0 1px #cf5b4e inset; }
.ship-hold-cell .good-icon { width: 78%; height: 78%; object-fit: contain; }
.hold-cell-abbr { font-size: 8px; line-height: 1; font-weight: 800; text-align: center; color: #b9d0df; }
.protected-slot-label { position: absolute; left: 1px; bottom: 0; padding: 0 2px; border-radius: 2px;
  background: #17111bcc; color: #b89bc7; font-size: 7px; font-weight: 800; line-height: 1.25; }
.hold-tile.empty { background: none; border: 1px dashed #57402580; }
.hold-tile.good { cursor: grab; }
.hold-tile.good:active { cursor: grabbing; }
.hold-tile.cargo-item[draggable="true"] { cursor: grab; }
.hold-tile.cargo-item[draggable="true"]:active { cursor: grabbing; }
.hold-tile.contraband { border-color: #cf5b4e; box-shadow: 0 0 0 1px #cf5b4e55; }
.hold-tile.sealed { background: #2a1f2e; border-color: #8a6aa2; }
.hold-tile.sealed.empty { background: none; border: 1px dashed #8a6aa288; color: #9a7aaa; }
.hold-tile.sealed.contraband { border-color: #cf5b4e; }
.hold-tile .good-icon { border: none !important; box-shadow: none !important; }
.seal-x { position: absolute; top: -6px; right: -6px; width: 15px; height: 15px; line-height: 12px;
  font-size: 11px; padding: 0; border-radius: 50%; background: #cf5b4e; color: #fff; border: none; cursor: pointer; }
.jettison-drop {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 8px;
  border: 1px dashed #cf5b4e;
  border-radius: 6px;
  color: #e0796c;
  background: #351d1a88;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.jettison-drop:hover { background: #4a221c; border-style: solid; }
.floating-cargo-list { display: flex; flex-direction: column; gap: 5px; }
.floating-cargo-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  background: var(--panel-2);
  cursor: pointer;
}
.floating-cargo-choice.picked { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.floating-cargo-choice.unavailable { opacity: 0.55; cursor: not-allowed; }
.cargo-item-glyph { font-size: 22px; line-height: 1; }


/* action buttons front and center (design ask 2026-07-20) */
#map-toolbar { z-index: 8; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,0.45); }
#map-toolbar button { font-size: 15px; padding: 8px 18px; }
#map-toolbar #route-info { max-width: 320px; }

/* wind compass, top-left over the map */
#wind-compass {
  position: absolute; top: 10px; left: 10px; z-index: 8;
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(13, 21, 33, 0.92);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; user-select: none;
}
#wind-arrow { font-size: 26px; line-height: 1; color: var(--gold); display: inline-block;
  transition: transform 0.4s ease; }
#wind-label { font-size: 12px; font-weight: 700; color: var(--fg-muted, #9ab); letter-spacing: 1px; }

/* Pirate's Guide (2026-07-23): always within reach while playing — a round
   button under the compass, opening the guide in an in-game overlay. */
#guide-link {
  position: absolute; top: 88px; left: 24px; z-index: 8; /* centered under the compass */
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(13, 21, 33, 0.92);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; text-decoration: none; user-select: none;
}
#guide-link:hover { background: #33405a; }

/* The guide overlay sits ABOVE game modals (60) so it can be consulted
   mid-battle, but below the dice cup (70) and toasts (80). */
#guide-overlay {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(7, 11, 18, 0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
#guide-overlay.hidden { display: none; }
#guide-frame-wrap {
  position: relative; width: min(1100px, 96vw); height: 92vh;
  background: var(--panel); border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6); overflow: hidden;
}
#guide-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
#guide-close {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}


/* dice roll animation (2026-07-21). The cup sits in the UPPER part of the
   screen, above the modal layer (z 70 > #modal-root's 60), so the outcome
   popup that lands in the same broadcast can never cover the tumbling roll. */
#dice-overlay { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 9vh; background: rgba(5, 9, 16, 0.45); z-index: 70; pointer-events: none; }
#dice-overlay.hidden { display: none; }
#dice-cup { display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 130px; height: 130px; border-radius: 22px;
  background: linear-gradient(145deg, #2a3b52, #16222f); border: 3px solid var(--gold);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
#dice-face { font-size: 52px; font-weight: 800; color: #f0e9d8; line-height: 1; }
#dice-label { font-size: 14px; color: var(--gold); margin-top: 6px; letter-spacing: 2px; }
#dice-overlay.rolling #dice-cup { animation: dice-shake 0.12s infinite; }
#dice-overlay.landed #dice-cup { animation: dice-land 0.35s ease-out; border-color: #f0e9d8; }
@keyframes dice-shake {
  0% { transform: translate(0, 0) rotate(-4deg); }
  50% { transform: translate(3px, -3px) rotate(4deg); }
  100% { transform: translate(-3px, 2px) rotate(-3deg); }
}
@keyframes dice-land {
  0% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* battle window (2026-07-23): combat runs in a modal — both ship boards side
   by side, plus one Ship Action slot and a Deck Action slot per crew member. */
.modal.combat { max-width: 940px; }
.combat-boards { display: flex; gap: 14px; }
.combat-boards .board-col { min-width: 0; }
/* Keep the two boards compact so the window fits 88vh on a 1080p screen. */
.combat-boards .ship-svg-wrap { max-width: 300px; width: 100%; margin: 4px auto; }
.combat-slots { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.combat-slot-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.combat-slot-wrap .slot-caption { text-align: center; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 130px; }
.combat-slot { flex: 1; min-height: 42px; border: 1px dashed var(--border); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; color: var(--muted); padding: 4px 8px; }
.combat-slot.filled { border: 1px solid var(--gold); background: #2a2417; color: var(--text); cursor: pointer; }
.combat-slot.filled:hover { background: #3a3220; }
.combat-slot.locked { cursor: default; }
.combat-slot.locked:hover { background: #2a2417; }
.combat-slot.exhausted { opacity: 0.45; border-style: solid; }
.combat-log { max-height: 110px; overflow-y: auto; background: #0d1725;
  border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; font-size: 12px; }
