/* hymaps-marine.css — live marine layer skins (vessels / buoys / cameras / tides)
 * ──────────────────────────────────────────────────────────────────────────
 * Engine-agnostic DOM marker skins (rendered inside .hm-mk-inner by
 * hymaps-engine.addMarker) + a shared glass info popup, owned by hymaps-marine.js.
 * NO hardcoded brand colors: every color resolves to a theme token with a safe
 * hex fallback. Cyberpunk neon glow is gated to the dark map type
 * (html.hm-mt-dark, set by hymaps-map.js) so clean/light/satellite/hybrid stay
 * calm. Heavy animation is gated to dark + disabled under reduced-motion.
 */

/* ── vessels ─────────────────────────────────────────────────────────────── */
/* Circular puck colored by vessel type (--mk), with a directional "bow" notch
 * at the top. The whole marker is rotated to heading by the engine, so the bow
 * points where the boat is going. */
.hm-marine-vessel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--mk, #3ac9ff);
  border: 1.5px solid rgba(255, 255, 255, .85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  cursor: pointer;
  transition: transform .12s ease;
}
.hm-marine-vessel iconify-icon { font-size: 16px; line-height: 1; }
/* Heading bow: a small triangle protruding from the top edge (points "up"). */
.hm-marine-bow {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--mk, #3ac9ff);
  filter: drop-shadow(0 -1px 0 rgba(255, 255, 255, .8));
}
.hm-marine-vessel:hover { transform: scale(1.08); }
/* Demo boats are visually distinct (dashed ring, slightly muted) + clearly not
 * "live" so the demo fallback never masquerades as real AIS. */
.hm-marine-vessel.is-demo {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .7);
  opacity: .88;
}
.hm-marine-vessel.is-demo::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .35);
}

/* ── buoys ───────────────────────────────────────────────────────────────── */
.hm-marine-buoy {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #04263a;
  background: var(--info, #3ac9ff);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.hm-marine-buoy iconify-icon { font-size: 15px; }
.hm-marine-buoy-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--info, #3ac9ff);
  opacity: .5;
}

/* ── coastal cameras ─────────────────────────────────────────────────────── */
/* Bottom-anchored pin so the tip sits on the coastline. */
.hm-marine-cam {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--purple, #a855f7);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 50% 50% 50% 4px;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  cursor: pointer;
}
.hm-marine-cam iconify-icon { font-size: 15px; transform: rotate(-45deg); }

/* ── tide / water chip ───────────────────────────────────────────────────── */
.hm-marine-tide-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font: 700 11px/1 -apple-system, system-ui, sans-serif;
  color: var(--text, #06304a);
  background: var(--bg-card, rgba(255, 255, 255, .95));
  border: 1px solid var(--info, #3ac9ff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  cursor: pointer;
}
.hm-marine-tide-chip iconify-icon { font-size: 14px; color: var(--info, #3ac9ff); }

/* ── shared info popup (glass card, bottom sheet on mobile) ──────────────── */
.hm-marine-pop {
  position: fixed;
  inset: 0;
  z-index: 6200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.hm-marine-pop.show { display: flex; }
.hm-marine-pop-card {
  position: relative;
  width: min(420px, 94vw);
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  padding: 16px 16px 14px;
  border-radius: 18px;
  color: var(--text, #0a1722);
  background: var(--bg-card, rgba(255, 255, 255, .98));
  border: 1px solid var(--border, rgba(0, 0, 0, .12));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  animation: hm-marine-rise .18s ease;
}
@keyframes hm-marine-rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.hm-marine-pop-x {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--muted, #6b7785);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.hm-marine-pop-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 800 15px/1.2 -apple-system, system-ui, sans-serif;
  margin: 0 26px 10px 0;
}
.hm-marine-pop-hd iconify-icon { font-size: 20px; color: var(--info, #3ac9ff); flex: none; }
.hm-marine-pop-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid var(--border, rgba(0, 0, 0, .08));
  font: 500 13px/1.3 -apple-system, system-ui, sans-serif;
}
.hm-marine-pop-row span { color: var(--muted, #6b7785); }
.hm-marine-pop-row b { font-weight: 700; text-align: right; }
.hm-marine-pop-row small { color: var(--muted, #6b7785); font-weight: 600; }
.hm-marine-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font: 800 10px/1.4 -apple-system, system-ui, sans-serif;
  letter-spacing: .04em;
}
.hm-marine-badge.is-live { background: var(--success, #22c55e); color: #06210f; }
.hm-marine-badge.is-demo { background: var(--warning, #fad015); color: #2a2300; }
.hm-marine-note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  font: 600 12px/1.35 -apple-system, system-ui, sans-serif;
  background: color-mix(in srgb, var(--warning, #fad015) 16%, transparent);
  border: 1px solid var(--warning, #fad015);
}
.hm-marine-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font: 700 13px system-ui;
  text-decoration: none;
  color: #00140b;
  background: var(--accent, #00ffa3);
}
.hm-marine-attrib {
  margin-top: 10px;
  font: 500 10.5px/1.35 -apple-system, system-ui, sans-serif;
  color: var(--muted, #6b7785);
}

/* ── cyberpunk neon — dark map only (gated for performance + taste) ───────── */
html.hm-mt-dark .hm-marine-vessel,
:root[data-hymaptype="dark"] .hm-marine-vessel {
  border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 0 10px var(--mk, #3ac9ff), 0 0 2px #fff;
}
html.hm-mt-dark .hm-marine-buoy,
:root[data-hymaptype="dark"] .hm-marine-buoy {
  box-shadow: 0 0 10px var(--info, #3ac9ff);
}
html.hm-mt-dark .hm-marine-buoy-ring,
:root[data-hymaptype="dark"] .hm-marine-buoy-ring {
  animation: hm-marine-pulse 2.4s ease-out infinite;
}
html.hm-mt-dark .hm-marine-cam,
:root[data-hymaptype="dark"] .hm-marine-cam {
  box-shadow: 0 0 10px var(--purple, #a855f7);
}
html.hm-mt-dark .hm-marine-tide-chip,
:root[data-hymaptype="dark"] .hm-marine-tide-chip {
  background: rgba(6, 18, 31, .92);
  color: var(--text, #d6fff2);
  box-shadow: 0 0 12px rgba(58, 201, 255, .55);
}
@keyframes hm-marine-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* Respect users who prefer less motion (and keep mobile cool). */
@media (prefers-reduced-motion: reduce) {
  .hm-marine-buoy-ring { animation: none !important; }
  .hm-marine-pop-card { animation: none; }
  .hm-marine-vessel { transition: none; }
}
