/* Ships sailing the world-map sea (public/worldmap-ships.js). One layer in
   the map host, above the tiles. The layer itself takes no clicks, so the
   hexes around a ship still open as usual; only the ship does. */
.worldmap-ship-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}

.worldmap-ship {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.worldmap-ship img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
  transition: filter 0.15s ease;
}

.worldmap-ship:hover img,
.worldmap-ship:focus-visible img,
.worldmap-ship.is-selected img {
  filter: drop-shadow(0 0 3px #fff8d6) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.worldmap-ship:focus-visible {
  outline: none;
}

/* Owned ships fly their owner's colour from the masthead. */
.worldmap-ship-flag {
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  width: 11px;
  height: 7px;
  border: 1px solid rgba(30, 20, 10, 0.75);
  border-radius: 1px 3px 3px 1px;
  pointer-events: none;
}

.worldmap-ship.is-owned .worldmap-ship-flag {
  display: block;
}

.worldmap-ship.is-own .worldmap-ship-flag {
  box-shadow: 0 0 0 1.5px #fff8d6;
}

/* Your ship has lost its berth: a pulsing warning badge over it. */
.worldmap-ship.is-warn::after {
  content: "!";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font: 700 11px/16px sans-serif;
  text-align: center;
  box-shadow: 0 0 0 1.5px #fff8d6;
  animation: worldmap-ship-warn 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes worldmap-ship-warn {
  50% { transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  .worldmap-ship.is-warn::after { animation: none; }
}

/* A bounty posted at a Pirate Cove (services/shipBounties.js): a small
   parchment tag with the gold on its head, hanging under the hull. */
.worldmap-ship-bounty-tag {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 0 4px 0 15px;
  border: 1px solid #5a3a14;
  border-radius: 3px;
  background: #f3dfa2 no-repeat 3px 50% / 9px 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='4' r='3.6' fill='%235a1d12'/%3E%3Crect x='3' y='6.5' width='4' height='3' rx='.6' fill='%235a1d12'/%3E%3Ccircle cx='3.7' cy='3.8' r='1' fill='%23f3dfa2'/%3E%3Ccircle cx='6.3' cy='3.8' r='1' fill='%23f3dfa2'/%3E%3C/svg%3E");
  color: #4a1d0e;
  font: 700 10px/14px "Cinzel", Georgia, serif;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* The course to the ship's next stop, drawn while its panel is open. */
.worldmap-ship-course {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.worldmap-ship-course-line {
  fill: none;
  stroke: #fff8d6;
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.7));
  animation: worldmap-ship-course-march 1.2s linear infinite;
}

.worldmap-ship-course-end {
  fill: rgba(255, 248, 214, 0.25);
  stroke: #fff8d6;
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

@keyframes worldmap-ship-course-march {
  to { stroke-dashoffset: -13; }
}

@media (prefers-reduced-motion: reduce) {
  .worldmap-ship-course-line { animation: none; }
}

/* Ship panel and the Shipyard section (views/tinybits/worldMapShipInfo.jsx,
   views/tinybits/hex/shipyard.jsx). */
.worldmap-ship-card,
.worldmap-ship-build {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.worldmap-ship-panel .worldmap-ship-card {
  padding: 4px 14px 16px;
}

.worldmap-ship-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.worldmap-ship-card-img {
  width: 64px;
  height: 64px;
  flex: none;
}

.worldmap-ship-card-name {
  display: block;
  font-size: 1.05rem;
}

.worldmap-ship-card-sub {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
}

.worldmap-ship-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.worldmap-ship-hold-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.worldmap-ship-hold-label i {
  color: #c99a2e;
}

.worldmap-ship-hold-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.worldmap-ship-hold-bar span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #e9c25a, #c99a2e);
}

.worldmap-ship-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.worldmap-ship-facts i {
  width: 1.1em;
  text-align: center;
  opacity: 0.75;
}

.worldmap-ship-eta {
  white-space: nowrap;
}

.worldmap-ship-build {
  align-items: center;
  text-align: center;
}

.worldmap-ship-build-img {
  width: 96px;
  height: 96px;
}

.worldmap-ship-build p {
  margin: 0;
}

.worldmap-ship-build-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

.worldmap-ship-find {
  align-self: center;
}

/* Upgrade to a cog: the offer in the Shipyard section, the deck picker
   (views/tinybits/worldMapShipUpgrade.jsx) and the cog's deck summary. */
.worldmap-ship-upgrade-offer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px dashed color-mix(in srgb, var(--wt-owner, #8a5a2b) 60%, transparent);
  border-radius: 10px;
  background: rgba(255, 248, 214, 0.25);
}

.worldmap-ship-upgrade-offer img {
  width: 64px;
  height: 64px;
  flex: none;
}

.worldmap-ship-upgrade-offer > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.85rem;
}

.worldmap-ship-upgrade-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.worldmap-ship-upgrade-compare > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8rem;
}

.worldmap-ship-upgrade-compare img {
  width: 72px;
  height: 72px;
}

.worldmap-ship-upgrade-compare > i {
  opacity: 0.6;
}

.worldmap-ship-upgrade-text {
  margin: 0;
  font-size: 0.88rem;
}

.worldmap-ship-upgrade-warning {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(180, 60, 40, 0.12);
  border: 1px solid rgba(180, 60, 40, 0.35);
}

.worldmap-ship-upgrade-warning i {
  color: #b43c28;
}

.worldmap-ship-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.worldmap-ship-deck-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: rgba(241, 228, 200, 0.96);
}

.worldmap-ship-deck-count {
  margin-right: auto;
  white-space: nowrap;
  font-size: 0.95rem;
  color: #b43c28;
}

.worldmap-ship-deck.is-ready .worldmap-ship-deck-count {
  color: #2f7a3a;
}

.worldmap-ship-deck-tool {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--resource-panel-border, rgba(0, 0, 0, 0.3));
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  margin: 0;
  flex: none;
  cursor: pointer;
}

.worldmap-ship-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.worldmap-ship-deck-card .deck-builder-card-image {
  height: 72px;
}

.worldmap-ship-deck-card .deck-builder-card-info {
  padding: 6px 4px;
}

.worldmap-ship-deck-card.is-picked {
  border-color: #c99a2e;
  box-shadow: 0 0 0 1.5px #c99a2e, 0 3px 12px rgba(0, 0, 0, 0.3);
}

/* No spare copy of it: the art dimmed until one is bought. */
.worldmap-ship-deck-card.is-unowned .deck-builder-card-image {
  filter: grayscale(0.7) brightness(0.8);
}

/* + and Buy swap with the [hidden] attribute (the deck-builder buttons are
   display:flex, which would otherwise show both). */
.worldmap-ship-deck-card .deck-builder-card-controls [hidden] {
  display: none;
}

.worldmap-ship-deck-card .deck-builder-card-controls {
  gap: 5px;
}

/* Buy one more copy and add it (public/worldmap-ships.js buyCard). */
.worldmap-ship-buy {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 7px;
  border-radius: 14px;
  border: 1.5px solid #a87a1e;
  background: linear-gradient(#f3d27a, #d9a93f);
  color: #3a2608;
  font-size: 0.74rem;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.worldmap-ship-buy .fa-coins {
  font-size: 0.85em;
}

.worldmap-ship-buy:hover:not(:disabled) {
  background: linear-gradient(#f8dc8f, #e2b44c);
}

.worldmap-ship-buy:disabled,
.worldmap-ship-deck-card.is-buying .worldmap-ship-buy {
  opacity: 0.55;
  cursor: progress;
}

.worldmap-ship-deck-submit {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 0 2px;
  background: rgba(241, 228, 200, 0.96);
}

.worldmap-ship-deck-summary summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.worldmap-ship-deck-summary ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.worldmap-ship-deck-summary li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

/* --- berths and harbour dues (Shipyard fleet, Port → Harbour) --- */

.worldmap-shipyard,
.worldmap-harbour {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.worldmap-ship-berths,
.worldmap-harbour-dues {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 248, 214, 0.35);
  border: 1px solid rgba(138, 90, 43, 0.25);
}

.worldmap-ship-berths > span:last-child,
.worldmap-harbour-dues > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.worldmap-ship-berths-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 96px;
  flex: none;
}

.worldmap-ship-berths-pips i {
  font-size: 1.05rem;
  opacity: 0.3;
}

.worldmap-ship-berths-pips i.is-used {
  opacity: 1;
  color: var(--wt-owner, #2f86a6);
}

.worldmap-harbour-dues > i {
  font-size: 1.6rem;
  color: #c9962b;
  flex: none;
}

.worldmap-harbour-calls {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.worldmap-harbour-calls li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.worldmap-harbour-calls li > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worldmap-harbour-calls li > span:nth-child(3) {
  opacity: 0.7;
  font-size: 0.78rem;
}

.worldmap-harbour-title {
  margin: 4px 0 0;
}

.worldmap-ship-build-blocked {
  opacity: 1;
  font-weight: 600;
}

/* A ship that lost its berth (views/tinybits/worldMapShipBerthWarning.jsx). */
.worldmap-ship-berth-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(160, 40, 30, 0.45);
  background: rgba(192, 57, 43, 0.12);
}

.worldmap-ship-berth-warning > i {
  color: #b03a2e;
  font-size: 1.3rem;
  flex: none;
  margin-top: 2px;
}

.worldmap-ship-berth-warning > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* ── Galleons and sea battles (views/tinybits/worldMapShipWar.jsx) ── */

/* Laid up after a lost battle: the ship sails on, battered and greyed. */
.worldmap-ship.is-hurt img {
  filter: grayscale(0.6) brightness(0.8) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
.worldmap-ship.is-hurt::before {
  content: "\f7a9"; /* heart-crack */
  position: absolute;
  right: -2px;
  top: -2px;
  font: 900 11px/16px "Font Awesome 6 Free";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #5a2a1a;
  color: #ffd7c9;
  text-align: center;
  box-shadow: 0 0 0 1.5px #fff8d6;
  pointer-events: none;
}

.worldmap-ship-war {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.worldmap-ship-war:empty { display: none; }
.worldmap-ship-war-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 0.9rem;
}
.worldmap-ship-war-notice {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(46, 125, 50, 0.15);
  border: 1px solid rgba(46, 125, 50, 0.5);
  font-size: 0.85rem;
}
.worldmap-ship-hull,
.worldmap-ship-bounty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(90, 42, 26, 0.12);
  border: 1px solid rgba(140, 60, 40, 0.4);
  font-size: 0.85rem;
}
.worldmap-ship-hull.is-laid-up { background: rgba(90, 42, 26, 0.22); }
.worldmap-ship-hull-pips { display: inline-flex; gap: 3px; color: #c0392b; }
.worldmap-ship-hull-pips .is-hit { color: #6b4a3a; }
.worldmap-ship-bounty { background: rgba(30, 20, 10, 0.14); }
.worldmap-ship-bounty i { color: #8a1c10; }

.worldmap-ship-command {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.worldmap-ship-orders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
}
.worldmap-ship-orders label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  cursor: pointer;
}
.worldmap-ship-orders label:has(input:checked) {
  border-color: var(--wt-owner, #2f86a6);
  box-shadow: 0 0 0 1px var(--wt-owner, #2f86a6);
}
.worldmap-ship-orders select,
.worldmap-ship-orders button { grid-column: 1 / -1; }
.worldmap-ship-orders select {
  min-height: 36px;
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
}
.worldmap-ship-auto {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.worldmap-ship-auto small { font-size: 0.75rem; opacity: 0.8; }
.worldmap-ship-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.4);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.worldmap-ship-toggle i { font-size: 1.2rem; color: #888; }
.worldmap-ship-toggle.is-on { border-color: #2e7d32; }
.worldmap-ship-toggle.is-on i { color: #2e7d32; }

.worldmap-ship-targets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.worldmap-ship-target {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.3);
}
.worldmap-ship-target.can-attack { border-color: rgba(192, 57, 43, 0.55); }
.worldmap-ship-target img { width: 40px; height: 40px; flex: none; }
.worldmap-ship-target-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.82rem;
}
.worldmap-ship-target-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worldmap-ship-target-why { opacity: 0.75; font-style: italic; }
.worldmap-ship-attack-btn {
  flex: none;
  align-self: center;
  background: linear-gradient(180deg, #d9533f, #a52a1c) !important;
  color: #fff !important;
  border-color: #7d1f15 !important;
  text-decoration: none;
}
.worldmap-ship-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}
.worldmap-ship-log li { padding: 3px 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.12); }
.worldmap-ship-log li.is-won::before { content: "⚓ "; }
.worldmap-ship-log li.is-lost { opacity: 0.8; }

.worldmap-ship-galleon-terms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}
.worldmap-ship-galleon-terms i { width: 18px; text-align: center; opacity: 0.8; }

/* Wrecks of sunk ships (services/shipWrecks.js): still, a little faded, under
   the sailing ships. A tap shows a caption saying what sank there. */
.worldmap-wreck {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.worldmap-wreck img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.92;
  filter: saturate(0.8) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.worldmap-wreck:hover img,
.worldmap-wreck.is-open img {
  opacity: 1;
  filter: drop-shadow(0 0 3px #fff8d6);
}

.worldmap-wreck:focus-visible {
  outline: none;
}

.worldmap-wreck-caption {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(28, 20, 12, 0.92);
  color: #f6ecd6;
  font: 600 12px/1.3 system-ui, sans-serif;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.worldmap-wreck.is-open .worldmap-wreck-caption {
  display: block;
}

/* Pirate Cove → Bounty Board (views/tinybits/hex/bounties.jsx). */
.worldmap-bounty-intro {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 10px;
}
.worldmap-bounty-intro > i {
  margin-top: 3px;
  color: var(--worldmap-bounty-ink, #7a2a18);
}
.worldmap-bounty-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.worldmap-bounty-ship {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(90, 58, 20, 0.35);
  border-radius: 8px;
  background: rgba(243, 223, 162, 0.35);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.worldmap-bounty-ship:hover,
.worldmap-bounty-ship:focus-visible {
  background: rgba(243, 223, 162, 0.6);
}
.worldmap-bounty-row.is-own .worldmap-bounty-ship {
  border-color: rgba(192, 57, 43, 0.6);
}
.worldmap-bounty-ship img {
  width: 40px;
  height: 40px;
  flex: none;
}
.worldmap-bounty-ship-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.worldmap-bounty-ship-main small {
  opacity: 0.8;
}
.worldmap-bounty-gold {
  flex: none;
  font-weight: 700;
  color: var(--worldmap-bounty-ink, #7a2a18);
  white-space: nowrap;
}
.worldmap-bounty-form {
  display: grid;
  gap: 8px;
}
.worldmap-bounty-form label {
  display: grid;
  gap: 3px;
}
.worldmap-bounty-form select,
.worldmap-bounty-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(90, 58, 20, 0.45);
  font: inherit;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .worldmap-bounty-intro > i,
  :root:not([data-theme="light"]) .worldmap-bounty-gold { color: #f0b48a; }
}
:root[data-theme="dark"] .worldmap-bounty-intro > i,
:root[data-theme="dark"] .worldmap-bounty-gold { color: #f0b48a; }
/* The Pirate Cove panel: its description lines up with the board below. */
.worldmap-cove > .worldmap-claim-land-desc {
  margin: 0;
  padding: 0 12px;
}

/* Pirates (services/piracy.js): a Port held by them, the den, the offer. */
.worldmap-port-hold {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(30, 20, 10, 0.5);
  background: rgba(28, 28, 28, 0.08);
}
.worldmap-port-hold > i {
  margin-top: 3px;
  font-size: 1.2em;
}
.worldmap-port-hold > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.worldmap-port-hold .cta {
  align-self: flex-start;
}
.wt-goals-pirate {
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  opacity: 0.9;
}
.wt-pirate .wt-quest-icon {
  background: #1c1c1c;
  color: #f3dfa2;
}

/* A pirate den on the sea (public/worldmap-ships.js): the den's owner always
   sees it, others only from a ship right next to it. */
.worldmap-den {
  position: absolute;
  left: 0;
  top: 0;
  width: 58px;
  height: 66px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}
.worldmap-den img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.worldmap-den.is-own img {
  filter: drop-shadow(0 0 3px #f3dfa2) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.worldmap-den .worldmap-wreck-caption {
  display: none;
}
.worldmap-den.is-open .worldmap-wreck-caption {
  display: block;
}
.worldmap-hex-badge-hijacked {
  background: #1c1c1c;
  color: #f3dfa2;
}

/* The Pirate King's missions (views/tinybits/hex/missions.jsx). */
.worldmap-mission-rank {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(28, 28, 28, 0.08);
}
.worldmap-mission-rank strong {
  font-family: "Cinzel", Georgia, serif;
}
.worldmap-mission-rank span {
  font-size: 0.9em;
  opacity: 0.85;
}
.worldmap-mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.worldmap-mission {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(90, 58, 20, 0.35);
  background: rgba(243, 223, 162, 0.3);
}
.worldmap-mission.is-active {
  border-color: rgba(122, 42, 24, 0.55);
}
.worldmap-mission.is-taken {
  opacity: 0.6;
}
.worldmap-mission-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.worldmap-mission-head > i {
  margin-top: 3px;
}
.worldmap-mission-title {
  font-weight: 600;
  min-width: 0;
}
.worldmap-mission-meta {
  opacity: 0.85;
}
.worldmap-mission .cta {
  justify-self: start;
}
.worldmap-mission-ships {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.worldmap-mission-ship.is-sailing {
  font-size: 0.9em;
}
.worldmap-mission-abandon {
  justify-self: end;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.85em;
  text-decoration: underline;
  opacity: 0.7;
  cursor: pointer;
}
.worldmap-mission-taken {
  font-size: 0.9em;
}

/* A ship on a treasure run carries a strongbox (services/realmTreasury.js):
   a gold tag over the sails with what is aboard. Any galleon can take it all. */
.worldmap-ship-treasure-tag {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  padding: 0 5px 0 16px;
  border: 1px solid #7a4e08;
  border-radius: 8px;
  background: linear-gradient(#ffe27a, #e0a722);
  color: #4a2a00;
  font: 700 10px/14px "Cinzel", Georgia, serif;
  white-space: nowrap;
  box-shadow: 0 0 6px rgba(255, 205, 70, 0.8), 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.worldmap-ship-treasure-tag::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 2px 2px 3px 3px;
  background: #7a4e08;
  box-shadow: inset 0 3px 0 #b3781a;
}

/* A caravan on the road (services/caravans.js): the cart, its owner's flag
   and the gold aboard. Pulses while its guards are fighting an ambush. */
.worldmap-caravan {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}
.worldmap-caravan img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.worldmap-caravan .worldmap-ship-flag {
  display: block;
  left: auto;
  position: absolute;
  right: 4px;
  top: 2px;
  width: 8px;
  height: 6px;
  border-radius: 1px;
}
.worldmap-caravan .worldmap-ship-treasure-tag { top: -10px; }
.worldmap-caravan.is-fight { animation: worldmap-caravan-fight 0.9s ease-in-out infinite; }
@keyframes worldmap-caravan-fight {
  50% { filter: drop-shadow(0 0 6px rgba(220, 40, 30, 0.9)); }
}
@media (prefers-reduced-motion: reduce) {
  .worldmap-caravan.is-fight { animation: none; filter: drop-shadow(0 0 5px rgba(220, 40, 30, 0.9)); }
}

/* Mercenaries (services/mercenaries.js). A hideout is drawn like a pirate
   den (the tents of the raiding-party camp); a war band is a banner token in
   its owner's colour. It bobs while marching, pulses red while fighting and
   is greyed while laid up. */
.worldmap-den.worldmap-hideout {
  width: 54px;
  height: 44px;
}
.worldmap-band {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}
.worldmap-band img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
/* The owner's colour, as a small flag on the band (the pennant is undyed). */
.worldmap-band .worldmap-ship-flag {
  display: block;
  position: absolute;
  left: 4px;
  top: 2px;
  width: 8px;
  height: 6px;
  border-radius: 1px;
  background: var(--band-color, #8a5a2b);
}
.worldmap-band.is-west img,
.worldmap-caravan.is-west img { transform: scaleX(-1); }
.worldmap-band.is-west .worldmap-ship-flag { left: auto; right: 4px; }
.worldmap-band.is-own { filter: drop-shadow(0 0 3px #f3dfa2) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.worldmap-band.is-hurt img { filter: grayscale(0.8) brightness(0.8); }
.worldmap-band.is-marching img { animation: worldmap-band-march 0.8s ease-in-out infinite; }
.worldmap-band.is-west.is-marching img { animation-name: worldmap-band-march-west; }
.worldmap-band.is-fight { animation: worldmap-caravan-fight 0.9s ease-in-out infinite; }
@keyframes worldmap-band-march {
  50% { transform: translateY(-2px); }
}
@keyframes worldmap-band-march-west {
  0%, 100% { transform: scaleX(-1); }
  50% { transform: scaleX(-1) translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .worldmap-band.is-marching img,
  .worldmap-band.is-fight { animation: none; }
}
.worldmap-hex-badge-occupied {
  background: #3a2414;
}


/* A raiding party on the march (services/raidMarch.js): the camp's tents,
   bobbing as they go, with its card count and its owner's flag. */
.worldmap-march img { animation: worldmap-march-bob 1.6s ease-in-out infinite; }
.worldmap-march.is-west img { animation-name: worldmap-march-bob-west; }
.worldmap-march.is-fight img { animation: none; }
.worldmap-march .worldmap-ship-treasure-tag { background: rgba(70, 40, 20, 0.85); }
@keyframes worldmap-march-bob {
  50% { transform: translateY(-2px); }
}
@keyframes worldmap-march-bob-west {
  0%, 100% { transform: scaleX(-1); }
  50% { transform: scaleX(-1) translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .worldmap-march img, .worldmap-march.is-west img { animation: none; }
}
