/* Ocean: a full-screen sea map with a navy info panel. Orange is the ship. */

:root {
  --navy: #0b2239;
  --navy-2: #143256;
  --line: rgba(255, 255, 255, .12);
  --text: #eef4fa;
  --muted: #9fb4ca;
  --ship: #ff6b35;
  --ok: #34d399;
  --warn: #fbbf24;
  --blue: #60a5fa;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--navy);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[hidden] { display: none !important; }
a { color: inherit; }

#map { position: fixed; inset: 0; background: #aad3df; }
.leaflet-container { font: inherit; }

/* ---------- ship on the map ---------- */

.ship-icon { background: none; border: 0; }
.ship { width: 26px; height: 52px; transition: transform .6s; }
.ship svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.ship-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ship);
  border: 3px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .4);
}
.pulse { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 3px solid var(--ship); opacity: 0; animation: pulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .ship { transition: none; } }

/* ---------- panel ---------- */

.panel {
  position: fixed;
  z-index: 1000;
  top: 16px;
  left: 16px;
  width: 360px;
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 34, 57, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.panel h1 { margin: 0; font-size: 1.55rem; letter-spacing: .04em; line-height: 1.1; }
.panel p { margin: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sub { color: var(--muted); margin-top: 2px !important; }
.badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, .1);
}
.badge.moving { background: rgba(52, 211, 153, .18); color: var(--ok); }
.badge.moored { background: rgba(96, 165, 250, .18); color: var(--blue); }
.badge.anchor { background: rgba(251, 191, 36, .18); color: var(--warn); }

.seen { margin: 14px 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--navy-2); }
.seen b { display: block; font-size: 1.2rem; }
.seen small { color: var(--muted); }
.seen.stale b { color: var(--warn); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 1px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.big { font-size: 1.35rem; font-weight: 750; color: #fff; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.links a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}
.links a:hover, .links a:focus-visible { border-color: var(--ship); }

.feed { display: flex; gap: 8px; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.feed .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); transform: translateY(1px); }
.feed .dot.ok { background: var(--ok); }
.waiting { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--navy-2); }
.waiting b { display: block; margin-bottom: 4px; }
.muted { color: var(--muted); }

.recenter {
  position: fixed;
  z-index: 1000;
  right: 16px;
  bottom: 28px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ship);
  color: #fff;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  cursor: pointer;
}
:focus-visible { outline: 3px solid var(--ship); outline-offset: 2px; }

/* Phones: the panel becomes a sheet at the bottom. */
@media (max-width: 700px) {
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 48%;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
  }
  .panel h1 { font-size: 1.3rem; }
  .recenter { top: 12px; bottom: auto; right: 12px; }
  .leaflet-top.leaflet-right { top: 52px; }
}
