/* BITÁCORA DEL ARCHIPIÉLAGO · Estética de carta náutica del s. XVIII (pergamino y tinta sepia) */
:root {
  --parchment: #f4ecda;
  --parchment-deep: #e6dac0;
  --ink: #2c241b;
  --ink-dim: #665845;
  --sea-frame: #20323a;
  --brass: #b8842c;
  --brass-hi: #e0b354;
  --red: #a83c2d;
  --border: #c9b998;
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #3a3026 0%, #1c1712 85%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13.5px;
  padding: 12px;
}

.game-shell {
  max-width: 1240px;
  margin: 0 auto;
  background: var(--parchment);
  border: 2px solid #7d6746;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.hud-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #f8f2e4 0%, #ebe0c7 100%);
  border-bottom: 2px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compass-icon { font-size: 24px; }

.brand h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.sub {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.hud-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric {
  background: #fbf7ed;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.metric strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.hud-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  background: #fbf6ea;
  color: var(--ink);
  border: 1px solid #b5a27e;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover:not(:disabled) {
  background: #f0e3c7;
  border-color: var(--brass);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-gold {
  background: linear-gradient(180deg, #d6a447 0%, #a87724 100%);
  color: #fffaf0;
  border-color: #855c18;
}

.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, #e0b258 0%, #b8842c 100%);
}

.btn-subtle {
  background: transparent;
  color: var(--ink-dim);
}

.btn-sm {
  padding: 4px 7px;
  font-size: 9.5px;
}

/* Lienzo del mar y overlays */
.sea-stage {
  position: relative;
  background: #cfdcd5;
}

#sea-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.contract-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(248, 242, 228, 0.92);
  border: 1.5px solid #b5a27e;
  border-radius: 8px;
  padding: 7px 12px;
  max-width: 420px;
  box-shadow: 0 6px 18px rgba(44, 36, 27, 0.16);
}

.mini-lbl {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.contract-pill strong {
  font-size: 12.5px;
  color: var(--ink);
}

.instrument-cluster {
  position: absolute;
  bottom: 42px;
  left: 12px;
}

.wind-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(248, 242, 228, 0.93);
  border: 1.5px solid #b5a27e;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(44, 36, 27, 0.18);
}

.wind-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.speed-txt {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
}

.sail-btns {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}

.dock-prompt {
  position: absolute;
  bottom: 48px;
  right: 16px;
  background: rgba(248, 242, 228, 0.96);
  border: 2px solid var(--brass);
  border-radius: 9px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 26px rgba(44, 36, 27, 0.24);
  font-weight: 700;
}

.toast {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #2c241b;
  color: #f7efe0;
  border: 1px solid var(--brass-hi);
  border-radius: 7px;
  padding: 8px 13px;
  font-family: var(--mono);
  font-size: 11px;
  max-width: 360px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.controls-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 7px 12px;
  background: #ebe0c7;
  border-top: 1.5px solid var(--border);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
}

.controls-strip b { color: var(--ink); }

.hidden { display: none !important; }

/* Modales de pergamino */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.parchment-modal {
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--parchment);
  border: 2.5px solid #8a704a;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-wide { max-width: 900px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.modal-head-btns {
  display: flex;
  gap: 8px;
}

.modal-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--brass);
}

.modal-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.port-lore {
  margin: 0 0 14px;
  font-style: italic;
  color: var(--ink-dim);
  line-height: 1.5;
}

.port-section {
  background: #fbf7ed;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 12px;
}

.sec-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 8px;
}

.lh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.contracts-list, .upgrades-grid, .bottles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f4ecda;
  border: 1px solid #d4c5a5;
  border-radius: 6px;
  padding: 8px 10px;
}

.item-row small {
  display: block;
  color: var(--ink-dim);
  font-size: 11.5px;
}

#fullmap-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1.5px solid #8a704a;
  border-radius: 6px;
}

.logbook-summary {
  background: #fbf7ed;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
}

.bottle-card {
  background: #fbf7ed;
  border-left: 3px solid var(--brass);
  padding: 8px 11px;
  border-radius: 4px;
}

.bottle-card.locked {
  opacity: 0.55;
  border-left-color: #b5a78d;
}
