:root {
  --ui-bg: #071018;
  --ui-text: #e8f1f4;
  --ui-text-soft: #c9d7e0;
  --ui-muted: #93a9b8;
  --cyan: #3dcfc4;
  --meso-mid: #0c2233;
  --meso-deep: #071624;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--meso-deep);
  color: var(--ui-text);
  font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
}

body.ocean-tank {
  overflow: hidden;
}

body.ocean-tank::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 42%, transparent 58%, rgba(2, 7, 13, 0.42) 88%, rgba(1, 4, 8, 0.66) 100%);
}

#ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--meso-mid);
}

.glass {
  position: fixed;
  inset: 18px;
  border: 1px solid rgba(147, 169, 184, 0.14);
  border-radius: 28px;
  pointer-events: none;
  z-index: 2;
}

.chrome {
  position: fixed;
  z-index: 4;
  left: 7vw;
  bottom: 9vh;
  max-width: 34rem;
  pointer-events: none;
}

#splash {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% 0%, rgba(142, 222, 212, 0.14), transparent 55%),
    linear-gradient(180deg, #123044 0%, var(--meso-mid) 34%, var(--meso-deep) 100%);
  transition: opacity 700ms ease;
}

#splash.is-gone {
  opacity: 0;
  pointer-events: none;
}

.zone {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ui-muted);
}

h1 {
  margin: 0;
  font-family: Fraunces, "Iowan Old Style", Palatino, serif;
  font-weight: 340;
  font-size: clamp(3rem, 6vw, 4.6rem);
  letter-spacing: -0.03em;
  color: var(--ui-text);
}

hr {
  width: 4.5rem;
  margin: 0.7rem 0 0.9rem;
  border: 0;
  border-top: 2px solid var(--cyan);
}

.reef-note,
.card-meta {
  margin: 0;
  color: var(--ui-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.card-title {
  margin: 0.8rem 0 0.15rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.card-sci {
  display: inline-block;
  margin: 0;
  color: var(--ui-text-soft);
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
  pointer-events: auto;
}

#card[hidden] { display: none; }

.card-share {
  pointer-events: auto;
  margin-top: 0.85rem;
  border: 1px solid rgba(147, 169, 184, 0.35);
  background: rgba(16, 28, 40, 0.72);
  color: var(--ui-text-soft);
  font: 500 0.88rem "Source Sans 3", sans-serif;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.card-share:hover { color: var(--ui-text); }

.card-share[hidden] { display: none; }

.card-share-note {
  margin: 0.45rem 0 0;
  color: var(--cyan);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.card-share-note[hidden] { display: none; }

#drop {
  position: fixed;
  z-index: 4;
  right: 28px;
  bottom: 28px;
  border: 1px solid rgba(147, 169, 184, 0.35);
  background: rgba(16, 28, 40, 0.72);
  color: var(--ui-text-soft);
  font: 500 0.92rem "Source Sans 3", sans-serif;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

#drop:hover { color: var(--ui-text); }

.hud {
  position: fixed;
  z-index: 4;
  top: 22px;
  right: 28px;
  display: flex;
  gap: 0.8rem;
  color: var(--ui-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  pointer-events: none;
}

.hud.is-quiet span:not(:first-child) { display: none; }

.sea-map {
  position: fixed;
  z-index: 5;
  top: 36px;
  left: 36px;
  width: 232px;
  padding: 0.7rem 0.75rem 0.75rem;
  border: 1px solid rgba(147, 169, 184, 0.28);
  border-radius: 18px;
  background: rgba(7, 16, 24, 0.72);
  color: var(--ui-text-soft);
}

.sea-map[hidden] { display: none !important; }

.sea-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-muted);
}

.sea-caption {
  margin: 0.2rem 0 0.35rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--ui-text-soft);
}

#sea-hexes svg {
  display: block;
  width: 100%;
  height: 210px;
}

.sea-hex { cursor: pointer; }

.sea-hex polygon {
  fill: rgba(8, 22, 34, 0.9);
  stroke: rgba(147, 169, 184, 0.45);
  stroke-width: 1.5;
}

.sea-hex.is-on polygon { stroke: var(--cyan); }

.sea-hex text {
  fill: #c9d7e0;
  font-size: 9px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

@media (max-width: 820px) {
  .sea-map {
    top: 12px;
    left: 12px;
    width: 168px;
    padding: 0.45rem 0.5rem 0.55rem;
  }

  #sea-hexes svg { height: 148px; }

  .sea-hex text { font-size: 8px; }
}

#sea-ride {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid rgba(147, 169, 184, 0.35);
  background: transparent;
  color: var(--ui-text-soft);
  font: 500 0.82rem "Source Sans 3", sans-serif;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

#sea-ride[aria-pressed="true"] {
  color: var(--ui-text);
  border-color: rgba(61, 207, 196, 0.7);
}

#sea-ride:hover { color: var(--ui-text); }

/* Share-card framing. The creature is the tank; the type sits in the open water. */
body.ocean-tank.is-portrait .glass {
  inset: 28px;
  border-radius: 18px;
  border-color: rgba(61, 207, 196, 0.28);
}

body.ocean-tank.is-portrait .chrome {
  left: 500px;
  right: 72px;
  top: 104px;
  bottom: auto;
  max-width: none;
}

body.ocean-tank.is-portrait .zone {
  margin: 0 0 16px;
  font-size: 14px;
  letter-spacing: 0.16em;
}

body.ocean-tank.is-portrait h1 {
  font-size: 48px;
  font-weight: 340;
  letter-spacing: 0.01em;
}

body.ocean-tank.is-portrait hr {
  width: 56px;
  margin: 12px 0 26px;
}

body.ocean-tank.is-portrait .card-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
}

body.ocean-tank.is-portrait .card-sci {
  display: block;
  margin: 0 0 18px;
  font-size: 22px;
}

body.ocean-tank.is-portrait .card-meta {
  font-size: 18px;
}

body.ocean-tank.is-portrait #drop,
body.ocean-tank.is-portrait .sea-map,
body.ocean-tank.is-portrait .hud,
body.ocean-tank.is-portrait .reef-note,
body.ocean-tank.is-portrait #splash,
body.ocean-tank.is-portrait .card-share,
body.ocean-tank.is-portrait .card-share-note {
  display: none !important;
}

@media (max-width: 700px) {
  .glass { inset: 10px; border-radius: 18px; }
  .chrome { left: 1.1rem; bottom: 5.5rem; }
  h1 { font-size: 2.6rem; }
}
