:root {
  --abyss: #021016;
  --deep: #072f3f;
  --mid: #0c4a5c;
  --foam: #e8f7f4;
  --mist: #c5e8e1;
  --cyan: #7ee0d6;
  --teal: #3aa89c;
  --glass: rgba(186, 232, 228, 0.12);
  --glass-strong: rgba(12, 42, 54, 0.46);
  --stroke: rgba(196, 240, 236, 0.32);
  --highlight: rgba(255, 255, 255, 0.38);
  --shadow: rgba(1, 8, 14, 0.45);
  --menubar-h: 52px;
  --sand-band: 178px;
  --dock-h: var(--sand-band);
  --font-ui: "Outfit", "Nunito Sans", system-ui, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--abyss);
  color: var(--foam);
  font-family: var(--font-ui);
  color-scheme: dark;
}

body {
  user-select: none;
}

button,
input,
textarea {
  font-family: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.aquarium {
  position: fixed;
  inset: 0;
  z-index: 0;
  transform-origin: 50% 30%;
  animation: dive-settle 3.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(150, 220, 230, 0.5), transparent 58%),
    radial-gradient(ellipse 45% 35% at 18% 78%, rgba(24, 92, 82, 0.28), transparent 70%),
    radial-gradient(ellipse 40% 30% at 86% 62%, rgba(18, 56, 96, 0.28), transparent 70%),
    linear-gradient(180deg, #1a6d82 0%, #0a4558 26%, #052433 68%, #021016 100%);
  pointer-events: none;
}

.water,
.tank {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.water {
  z-index: 0;
  display: none;
}

.tank {
  z-index: 1;
}

.gl-water .water {
  display: block;
}

.gl-water .water-surface,
.gl-water .light-rays,
.gl-water .caustics,
.gl-water .rocks,
.gl-water .sand {
  display: none;
}

.water-surface {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(210, 240, 245, 0.4), rgba(160, 220, 230, 0.12) 42%, transparent);
  box-shadow: inset 0 18px 40px rgba(200, 240, 255, 0.08);
}

.light-rays {
  position: absolute;
  inset: -10% 0 20%;
  z-index: 2;
  background:
    linear-gradient(108deg, transparent 36%, rgba(190, 235, 245, 0.14) 39%, transparent 46%),
    linear-gradient(96deg, transparent 48%, rgba(160, 220, 235, 0.12) 53%, transparent 61%),
    linear-gradient(118deg, transparent 18%, rgba(210, 245, 255, 0.12) 24%, transparent 33%);
  animation: drift-rays 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 20%, transparent 92%);
}

.caustics {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.28;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18) 0 2%, transparent 18%),
    radial-gradient(circle at 70% 0%, rgba(180, 240, 255, 0.14) 0 3%, transparent 22%),
    radial-gradient(circle at 40% 18%, rgba(255, 255, 255, 0.1) 0 2%, transparent 16%);
  background-size: 180% 180%;
  animation: caustic-shift 22s linear infinite;
  mix-blend-mode: soft-light;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 52%, rgba(1, 8, 14, 0.42) 100%),
    linear-gradient(180deg, rgba(1, 8, 14, 0.18), transparent 14%);
  box-shadow: inset 0 0 120px rgba(0, 10, 16, 0.3);
}

.seabed {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 148px;
  z-index: 2;
}

.rocks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  width: 100%;
  height: 120px;
}

.coral {
  position: absolute;
  bottom: 16px;
  height: 72px;
  pointer-events: none;
  z-index: 1;
}

.coral-left {
  left: 2.5vw;
  width: 82px;
}

.coral-right {
  right: 2vw;
  width: 180px;
}

.coral .star {
  transform-origin: 516px 124px;
  animation: sway 11s ease-in-out infinite;
}

.sand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  background:
    radial-gradient(circle at 12% 40%, #c9b089 2px, transparent 3px),
    radial-gradient(circle at 28% 70%, #b08962 1.5px, transparent 2px),
    radial-gradient(circle at 63% 30%, #d8c4a0 2px, transparent 3px),
    radial-gradient(circle at 81% 62%, #a57c54 1.5px, transparent 2px),
    linear-gradient(180deg, #8d7354 0%, #6d5842 100%);
  box-shadow: 0 -18px 40px rgba(8, 20, 18, 0.35);
}

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--menubar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  pointer-events: none;
  animation: chrome-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.6s both;
}

.logo,
.clock,
.tank-readout,
.tide-toggle,
.sonar-toggle {
  pointer-events: auto;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tide-toggle {
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.28);
  border: 1px solid rgba(180, 230, 226, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--foam);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tide-toggle:hover {
  background: rgba(20, 60, 72, 0.42);
  border-color: rgba(200, 245, 240, 0.32);
}

.tide-glyph {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff8d8, #ffd66b 60%, #f0a83a);
  box-shadow: 0 0 10px rgba(255, 214, 107, 0.75);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

body[data-tide="dusk"] .tide-glyph {
  background: linear-gradient(180deg, #ffd2a0 0 52%, transparent 52%), radial-gradient(circle, #ff9a5a, #e0603a);
  background-blend-mode: normal;
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 58%);
  mask-image: linear-gradient(180deg, #000 58%, transparent 58%);
  box-shadow: 0 0 10px rgba(255, 150, 90, 0.7);
}

body[data-tide="night"] .tide-glyph {
  background: transparent;
  box-shadow: inset -3.5px 1px 0 0 #e4ecff, 0 0 8px -2px rgba(200, 220, 255, 0.7);
}
.tank-readout {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.28);
  border: 1px solid rgba(180, 230, 226, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--mist);
}

.snap-ghost {
  position: fixed;
  top: var(--menubar-h);
  bottom: var(--dock-h);
  z-index: 9;
  width: calc(50% - 10px);
  pointer-events: none;
  border-radius: 18px;
  background: rgba(126, 224, 214, 0.12);
  border: 1px solid rgba(210, 250, 246, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.snap-ghost[data-side="left"] {
  left: 8px;
}

.snap-ghost[data-side="right"] {
  right: 8px;
  left: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.28);
  border: 1px solid rgba(180, 230, 226, 0.18);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--highlight);
  cursor: pointer;
}

.logo-mark {
  width: 32px;
  height: 20px;
}

.logo-type {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--foam);
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.28);
  border: 1px solid rgba(180, 230, 226, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.desktop {
  position: fixed;
  inset: var(--menubar-h) 0 var(--dock-h) 0;
  z-index: 10;
  cursor: cell;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  min-height: 180px;
  cursor: default;
  border-radius: 20px;
  background:
    radial-gradient(110% 70% at 0% 0%, color-mix(in srgb, var(--accent, #7ee0d6) 32%, transparent), transparent 62%),
    radial-gradient(80% 55% at 100% 100%, color-mix(in srgb, var(--accent, #7ee0d6) 16%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(200, 238, 236, 0.08), color-mix(in srgb, var(--accent, #7ee0d6) 10%, rgba(8, 30, 40, 0.58)) 42%, color-mix(in srgb, var(--accent, #7ee0d6) 5%, rgba(4, 20, 30, 0.7)));
  border: 1px solid rgba(196, 240, 236, 0.14);
  box-shadow:
    0 40px 80px -24px rgba(0, 6, 12, 0.72),
    0 12px 28px rgba(0, 8, 14, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 50px rgba(90, 180, 176, 0.07);
  backdrop-filter: blur(24px) saturate(1.5) brightness(1.04);
  -webkit-backdrop-filter: blur(24px) saturate(1.5) brightness(1.04);
  color: var(--foam);
  overflow: hidden;
  isolation: isolate;
  transform-origin: 50% 100%;
  animation: window-in 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.08) 26%,
    color-mix(in srgb, var(--accent, #7ee0d6) 6%, transparent) 64%,
    color-mix(in srgb, var(--accent, #7ee0d6) 60%, transparent)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(220, 255, 250, 0.07) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(220, 255, 250, 0.05) 55%,
    transparent 65%
  );
  background-size: 300% 100%;
  background-position: 120% 0;
  opacity: 0;
}

.window.is-active {
  border-color: rgba(210, 250, 246, 0.28);
  box-shadow:
    0 48px 90px -24px rgba(0, 6, 12, 0.8),
    0 14px 34px rgba(0, 8, 14, 0.36),
    0 0 0 1px color-mix(in srgb, var(--accent, #7ee0d6) 18%, transparent),
    0 0 70px -10px color-mix(in srgb, var(--accent, #7ee0d6) 32%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 0 60px rgba(110, 210, 200, 0.1);
}

.window.is-active::before {
  opacity: 1;
}

.window.is-active::after {
  opacity: 1;
  animation: glass-sheen 9s ease-in-out 0.6s infinite;
}

.window.is-nudge {
  animation: nudge 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.window.is-closing {
  animation: window-out 0.26s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

.window.is-sinking {
  animation: window-sink 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

.window.is-minimized {
  display: none !important;
  animation: none;
}

.window.is-morphing {
  transition:
    left 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.34s ease;
}

.window.is-max {
  border-radius: 14px;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.window-bead {
  position: relative;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.18),
    0 3px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.window-bead:hover,
.window-bead:focus-visible {
  transform: scale(1.14);
}

.window:not(.is-active) .window-bead {
  filter: saturate(0.35) brightness(0.85);
}

.window-min {
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, #e6d6b8 40%, #9a7d55 100%);
}

.window-max {
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, #b2ece2 40%, #3aa89c 100%);
}

.window-bead::before,
.window-bead::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1.5px;
  background: rgba(8, 40, 44, 0.72);
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.window-max::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.window-min::after {
  display: none;
}

.window-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 12px 0 12px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--accent, #7ee0d6) 30%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent);
}

.window-titlebar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #7ee0d6) 55%, transparent), rgba(200, 245, 240, 0.12) 50%, transparent);
}

.window-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--accent, var(--cyan));
  background: color-mix(in srgb, var(--accent, #7ee0d6) 18%, rgba(4, 20, 28, 0.4));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent, #7ee0d6) 40%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.3s ease;
}

.window-icon svg {
  width: 15px;
  height: 15px;
}

.window.is-active .window-icon {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent, #7ee0d6) 65%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 14px color-mix(in srgb, var(--accent, #7ee0d6) 45%, transparent);
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-title {
  flex: 1;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(232, 247, 244, 0.72);
  transition: color 0.3s ease;
}

.window.is-active .window-title {
  color: var(--foam);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent, #7ee0d6) 45%, transparent);
}

.window-close {
  background:
    radial-gradient(circle at 35% 30%, #fff 0 14%, #c6f0e8 38%, #6fb8b0 100%);
}

.window-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.window-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.window-close:hover,
.window-close:focus-visible {
  background:
    radial-gradient(circle at 35% 30%, #fff 0 14%, #ffd4c8 40%, #e08978 100%);
}

.window-bead:hover::before,
.window-bead:hover::after,
.window-bead:focus-visible::before,
.window-bead:focus-visible::after {
  opacity: 1;
}

.window-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: 12px 14px 16px;
  overflow: auto;
}

.sand-props {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--sand-band);
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  flex-wrap: nowrap;
  gap: 2px 8px;
  padding: 0 8vw 40px;
  pointer-events: none;
}

.sand-prop {
  appearance: none;
  position: relative;
  pointer-events: auto;
  border: 0;
  background: transparent;
  color: var(--foam);
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 6px 0;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  opacity: 0.2;
  transform: translateY(28px);
}

body.is-ready .sand-prop {
  animation: prop-settle 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(1.5s + var(--i, 0) * 90ms);
}

.sand-prop:focus {
  outline: none;
}

.sand-prop::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: calc(var(--prop-size, 64px) * 2);
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--accent, #7ee0d6) 60%, transparent),
    color-mix(in srgb, var(--accent, #7ee0d6) 16%, transparent) 45%,
    transparent 70%
  );
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sand-prop:hover::before,
.sand-prop:focus-visible::before,
.sand-prop.is-active::before {
  opacity: 1;
}

.sand-prop.is-open:not(:hover):not(.is-active)::before {
  opacity: 0.75;
}

.sand-prop:hover .sand-prop-art,
.sand-prop:focus-visible .sand-prop-art {
  translate: 0 -8px;
  scale: 1.08;
  filter:
    brightness(1.12)
    drop-shadow(0 14px 10px rgba(8, 16, 14, 0.42))
    drop-shadow(0 0 16px color-mix(in srgb, var(--accent, #7ee0d6) 55%, transparent));
}

.sand-prop-art {
  position: relative;
  z-index: 1;
  width: var(--prop-size, 64px);
  height: var(--prop-size, 64px);
  display: grid;
  place-items: end center;
  transform-origin: 50% 88%;
  animation: prop-sway var(--sway, 8.5s) ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -1.3s);
  filter:
    drop-shadow(0 10px 8px rgba(8, 16, 14, 0.4))
    drop-shadow(0 0 1.5px color-mix(in srgb, var(--accent, #7ee0d6) 70%, transparent));
  transition: translate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), scale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.sand-prop-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.prop-silt {
  fill: #4a3a2c;
  opacity: 0.55;
}

.sand-prop-mound {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: calc(var(--prop-size, 64px) * 0.72);
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(42, 32, 22, 0.45), transparent 70%);
  pointer-events: none;
}

.sand-prop-halo {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: calc(var(--prop-size, 64px) * 1.5);
  height: calc(var(--prop-size, 64px) * 1.3);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 60%,
    color-mix(in srgb, var(--accent, #7ee0d6) 34%, transparent),
    color-mix(in srgb, var(--accent, #7ee0d6) 8%, transparent) 50%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.sand-prop:hover .sand-prop-halo,
.sand-prop:focus-visible .sand-prop-halo,
.sand-prop.is-active .sand-prop-halo {
  opacity: 1;
}

.sand-prop.is-pressed .sand-prop-halo {
  opacity: 1;
  animation: halo-pulse 0.42s ease;
}

.sand-prop:focus-visible .sand-prop-label {
  outline: 2px solid var(--accent, var(--cyan));
  outline-offset: 2px;
}

.sand-prop-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: rgba(4, 18, 24, 0.58);
  border: 1px solid color-mix(in srgb, var(--accent, #7ee0d6) 38%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: color-mix(in srgb, var(--accent, #7ee0d6) 35%, #f4fffc);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 8, 12, 0.6);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sand-prop-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 8px var(--accent, var(--cyan));
}

.sand-prop:hover .sand-prop-label,
.sand-prop:focus-visible .sand-prop-label,
.sand-prop.is-active .sand-prop-label {
  background: color-mix(in srgb, var(--accent, #7ee0d6) 24%, rgba(4, 18, 24, 0.7));
  border-color: color-mix(in srgb, var(--accent, #7ee0d6) 75%, transparent);
  color: #fff;
}

.sand-prop-pearl {
  position: absolute;
  left: calc(50% + var(--prop-size, 64px) * 0.32);
  bottom: calc(var(--prop-size, 64px) * 0.66);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--accent, #7ee0d6) 70%);
  box-shadow: 0 0 10px var(--accent, #7ee0d6);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sand-prop.is-open .sand-prop-pearl,
.sand-prop.is-active .sand-prop-pearl {
  opacity: 0.95;
}

.sand-prop.is-active .sand-prop-pearl {
  transform: scale(1.2);
  box-shadow: 0 0 14px var(--accent, var(--cyan));
}

.sand-prop.is-sleeping .sand-prop-pearl {
  opacity: 0.35;
  background: radial-gradient(circle at 35% 30%, #d7e0dc, #8aa09a 70%);
  box-shadow: none;
}

.sand-prop-sleep {
  position: absolute;
  left: calc(50% + 10px);
  bottom: calc(var(--prop-size, 64px) * 0.78);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.4px solid rgba(186, 232, 228, 0.55);
  background: rgba(186, 232, 228, 0.12);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.sand-prop-sleep::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.2px solid rgba(186, 232, 228, 0.4);
}

.sand-prop.is-sleeping .sand-prop-sleep {
  opacity: 0.85;
  animation: sleep-bubble 2.4s ease-in-out infinite;
}

.sand-prop.is-sleeping .sand-prop-art {
  filter: brightness(0.72) saturate(0.82) drop-shadow(0 10px 8px rgba(8, 16, 14, 0.38));
}

.sand-prop.is-sleeping .cabin-window,
.sand-prop.is-sleeping .oyster-pearl {
  fill: #3a4e46;
}

.sand-prop.is-feeding .anemone-arms {
  animation: tentacle-feed 0.45s ease-in-out 2;
}

.sand-prop-feed.is-feeding .sand-prop-halo {
  opacity: 1;
}

.sand-prop-feed { --prop-size: clamp(72px, 7.5vw, 108px); }
.sand-prop-notes { --prop-size: clamp(88px, 9.2vw, 132px); }
.sand-prop-calc { --prop-size: clamp(76px, 8vw, 116px); }
.sand-prop-music { --prop-size: clamp(72px, 7.6vw, 110px); }
.sand-prop-about { --prop-size: clamp(76px, 8vw, 116px); }
.sand-prop-guide { --prop-size: clamp(76px, 8vw, 114px); }

.sand-prop-feed .sand-prop-pearl,
.sand-prop-feed .sand-prop-sleep {
  display: none;
}

.app-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.notes-status {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: 0.7;
}

.app-about,
.app-music,
.app-calc {
  height: 100%;
}

.notes-editor,
.app-about,
.calc-display {
  user-select: text;
}

.notes-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(1.6em - 1px), rgba(170, 235, 228, 0.08) calc(1.6em - 1px) 1.6em) 0 14px / 100% 1.6em local,
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  color: var(--foam);
  caret-color: var(--accent, var(--cyan));
  font-size: 1.05rem;
  line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgba(200, 240, 236, 0.12), inset 0 10px 24px rgba(0, 10, 16, 0.12);
  transition: box-shadow 0.25s ease;
}

.notes-editor:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent, #7ee0d6) 45%, transparent),
    inset 0 10px 24px rgba(0, 10, 16, 0.12),
    0 0 0 4px color-mix(in srgb, var(--accent, #7ee0d6) 10%, transparent);
}

.notes-editor::placeholder {
  color: rgba(197, 232, 225, 0.45);
}

.app-calc {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.calc-display {
  min-height: 72px;
  padding: 10px 16px 12px;
  border-radius: 14px;
  background: rgba(4, 22, 30, 0.45);
  border: 1px solid rgba(180, 230, 226, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.calc-tape {
  min-height: 1em;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--mist);
  opacity: 0.7;
}

.calc-value {
  font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-shadow: 0 0 20px rgba(126, 224, 214, 0.35);
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-keys button {
  appearance: none;
  min-height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(200, 240, 236, 0.13), rgba(186, 232, 228, 0.06));
  border: 1px solid rgba(200, 240, 236, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 10, 16, 0.15);
  color: var(--foam);
  font-size: 1.15rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.calc-keys button:hover,
.calc-keys button:focus-visible {
  background: linear-gradient(180deg, rgba(200, 240, 236, 0.22), rgba(186, 232, 228, 0.1));
}

.calc-keys button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.calc-keys .op {
  background: linear-gradient(180deg, rgba(80, 190, 176, 0.3), rgba(58, 168, 156, 0.16));
  color: #d7fff6;
}

.calc-keys .eq {
  grid-column: span 4;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #7ee0d6) 55%, #fff), var(--accent, #7ee0d6));
  border-color: rgba(255, 250, 230, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 18px color-mix(in srgb, var(--accent, #7ee0d6) 35%, transparent);
  color: #2a1c04;
  font-size: 1.25rem;
  font-weight: 600;
}

.calc-keys .eq:hover,
.calc-keys .eq:focus-visible {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #7ee0d6) 35%, #fff), color-mix(in srgb, var(--accent, #7ee0d6) 85%, #fff));
}

.app-music {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.music-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 560;
}

.music-sub {
  margin: 4px 0 0;
  color: var(--mist);
  font-size: 0.88rem;
}

.music-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.music-disc {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), transparent 30%),
    conic-gradient(from 20deg, #b8f0ea, #e8d4f4, #f6e6c8, #b0e4f0, #d4f4dc, #f0d0e4, #b8f0ea);
  box-shadow:
    0 8px 22px rgba(0, 10, 16, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 -6px 14px rgba(40, 80, 90, 0.25);
  animation: disc-spin 9s linear infinite paused;
}

.music-disc span {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #7ee0d6 60%, #3aa89c);
  box-shadow: 0 0 0 4px rgba(6, 30, 40, 0.35);
}

.app-music.is-playing .music-disc {
  animation-play-state: running;
}

.music-eq {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
}

.music-eq span {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(180deg, #fff, var(--accent, var(--cyan)) 45%, color-mix(in srgb, var(--accent, #7ee0d6) 60%, #3a2040));
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.music-eq span:nth-child(3n) { height: 14px; }
.music-eq span:nth-child(2n) { height: 10px; }

.app-music.is-playing .music-eq span {
  opacity: 0.9;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent, #7ee0d6) 45%, transparent);
  animation: eq-wave 1.1s ease-in-out infinite;
}

.app-music.is-playing .music-eq span:nth-child(2n) { animation-duration: 0.9s; animation-delay: -0.2s; }
.app-music.is-playing .music-eq span:nth-child(3n) { animation-duration: 1.3s; animation-delay: -0.45s; }
.app-music.is-playing .music-eq span:nth-child(5n) { animation-duration: 0.8s; animation-delay: -0.1s; }
.app-music.is-playing .music-eq span:nth-child(7n) { animation-duration: 1.5s; animation-delay: -0.35s; }

.music-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 16%, color-mix(in srgb, var(--accent, #7ee0d6) 60%, #fff) 42%, color-mix(in srgb, var(--accent, #7ee0d6) 80%, #3a2040) 100%);
  color: #2a0a1c;
  box-shadow: 0 8px 18px rgba(0, 10, 16, 0.25);
}

.play-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.music-progress,
.music-volume {
  width: 100%;
  accent-color: var(--accent, var(--cyan));
  cursor: pointer;
}

.time-row,
.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mist);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.volume-row svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.app-about {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 8px 6px 4px;
}

.about-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent, var(--cyan));
}

.about-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 650;
}

.about-lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--mist);
}

.about-copy {
  margin: 8px 0 0;
  line-height: 1.55;
  color: rgba(232, 247, 244, 0.86);
}

@keyframes drift-rays {
  from { transform: translateX(-4%) rotate(-1deg); }
  to { transform: translateX(5%) rotate(1.4deg); }
}

@keyframes caustic-shift {
  from { background-position: 0% 0%; }
  to { background-position: 40% 18%; }
}

@keyframes sway {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(4deg); }
}

@keyframes window-in {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.92);
  }
  55% {
    opacity: 1;
    transform: translateY(-4px) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes window-out {
  to {
    opacity: 0;
    transform: translateY(-26px) scale(0.94);
  }
}

@keyframes window-sink {
  to {
    opacity: 0;
    transform: translateY(80px) scale(0.6);
  }
}

@keyframes glass-sheen {
  0% { background-position: 120% 0; }
  45%, 100% { background-position: -20% 0; }
}

@keyframes chrome-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes disc-spin {
  to { transform: rotate(360deg); }
}

@keyframes dive-title {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.96);
    filter: blur(10px);
  }
  22%, 62% {
    opacity: 1;
    transform: translate(-50%, -50%);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90%) scale(1.02);
    filter: blur(8px);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: none;
  }
  45% {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes eq-wave {
  0%, 100% { height: 6px; }
  50% { height: 32px; }
}

@keyframes prop-settle {
  to {
    opacity: 1;
    transform: translateY(var(--bury, 8px));
  }
}

@keyframes prop-sway {
  0%, 100% { transform: rotate(-2.4deg); }
  50% { transform: rotate(2.8deg); }
}

@keyframes halo-pulse {
  0% { transform: translateX(-50%) scale(0.92); }
  45% { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); }
}

@keyframes sleep-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes tentacle-feed {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}

@media (max-width: 720px) {
  :root {
    --sand-band: 128px;
  }

  .clock,
  .tank-readout,
  .tide-toggle {
    font-size: 0.75rem;
    padding: 5px 8px;
    white-space: nowrap;
  }

  .tank-readout,
  .sonar-word,
  .sonar-key {
    display: none;
  }

  .sonar-toggle {
    padding: 5px 8px;
  }

  .menubar {
    padding: 0 10px;
  }

  .status-cluster {
    gap: 4px;
  }

  .sand-props {
    padding: 0 4vw 30px;
    gap: 0 4px;
  }

  .sand-prop {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 2px 0;
  }

  .sand-prop-label {
    font-size: 0.64rem;
    padding: 2px 7px 2px 6px;
    letter-spacing: 0.03em;
  }

  .sand-prop-label::before {
    display: none;
  }

  .sand-prop-notes { --prop-size: 74px; }
  .sand-prop-guide,
  .sand-prop-feed,
  .sand-prop-calc,
  .sand-prop-music,
  .sand-prop-about { --prop-size: 64px; }

  .window {
    max-width: calc(100vw - 16px);
  }
}

@media (max-width: 440px) {
  .logo {
    gap: 6px;
    padding: 5px 10px 5px 6px;
  }

  .logo-mark {
    width: 24px;
    height: 15px;
  }

  .logo-type {
    font-size: 0.98rem;
  }
}

@media (max-width: 400px) {
  :root {
    --sand-band: 120px;
  }

  .sand-props {
    padding: 0 2vw 28px;
  }

  .sand-prop {
    --prop-size: 56px;
  }

  .sand-prop-notes {
    --prop-size: 64px;
  }

  .sand-prop-label {
    font-size: 0.58rem;
    padding: 2px 5px;
  }

  .coral {
    display: none;
  }
}

.divelog {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sand-band) + 14px);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background:
    linear-gradient(100deg, rgba(126, 224, 214, 0.16), transparent 55%),
    rgba(6, 28, 38, 0.62);
  border: 1px solid rgba(180, 230, 226, 0.26);
  color: var(--foam);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 40px -16px rgba(0, 8, 14, 0.7);
  transform: translateX(-50%);
  animation: divelog-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

.divelog.is-gone {
  opacity: 0;
  transform: translate(-50%, 12px);
}

.divelog.is-ticked {
  border-color: rgba(240, 214, 150, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 34px -6px rgba(240, 200, 120, 0.55);
}

.divelog.is-ticked .divelog-text {
  animation: divelog-swap 0.65s ease both;
}

.divelog-kicker {
  flex: none;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.divelog-dots {
  flex: none;
  display: inline-flex;
  gap: 5px;
}

.divelog-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.2px solid rgba(186, 232, 228, 0.45);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.divelog-dots i.is-now {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(126, 224, 214, 0.8);
  animation: divelog-now 1.6s ease-in-out infinite;
}

.divelog-dots i.is-done {
  border-color: #f0c878;
  background: radial-gradient(circle at 35% 30%, #fffbe8, #f0c878 60%, #c88a3a);
}

.divelog-text {
  margin: 0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.divelog-action {
  flex: none;
  font: inherit;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  color: #08222a;
  background: linear-gradient(180deg, #c8ecff, #a8c4ff);
  border: 0;
  cursor: pointer;
}

.divelog-hide {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(186, 232, 228, 0.08);
  color: var(--mist);
  cursor: pointer;
}

.divelog-hide svg {
  width: 12px;
  height: 12px;
}

.divelog-hide:hover {
  background: rgba(186, 232, 228, 0.18);
}

.feed-cue {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.feed-cue.is-on {
  opacity: 1;
}

.feed-cue span {
  position: absolute;
  left: -48px;
  top: -48px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 214, 150, 0.7);
  animation: feed-cue-ring 2.4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

.feed-cue span:nth-child(2) {
  animation-delay: 1.2s;
}

.feed-cue i {
  position: absolute;
  left: -3px;
  top: -2px;
  width: 6px;
  height: 4px;
  border-radius: 50%;
  background: #e8b05c;
  box-shadow: 0 0 8px rgba(255, 200, 120, 0.8);
  animation: feed-cue-flake 2.4s ease-in infinite;
}

.feed-cue i:nth-of-type(2) {
  left: -14px;
  animation-delay: 0.5s;
}

.feed-cue i:nth-of-type(3) {
  left: 9px;
  animation-delay: 1s;
}

.feed-cue b {
  position: absolute;
  left: 0;
  top: 58px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f6dca0;
  text-shadow: 0 0 14px rgba(240, 190, 100, 0.8), 0 2px 8px rgba(0, 10, 16, 0.7);
  animation: feed-cue-label 2.4s ease-in-out infinite;
}

@keyframes feed-cue-label {
  50% { opacity: 0.55; }
}

@keyframes dive-settle {
  from {
    transform: scale(1.12);
    filter: blur(5px) brightness(1.3) saturate(1.2);
  }
  45% {
    filter: blur(0) brightness(1.08);
  }
  to {
    transform: none;
    filter: none;
  }
}

@keyframes divelog-in {
  from {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.96);
  }
}

@keyframes divelog-swap {
  0% { opacity: 1; transform: none; }
  40% { opacity: 0; transform: translateY(-6px); }
  60% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: none; }
}

@keyframes divelog-now {
  50% { transform: scale(1.35); }
}

@keyframes feed-cue-ring {
  from {
    transform: scale(0.2);
    opacity: 0.9;
  }
  to {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes feed-cue-flake {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  to {
    transform: translateY(30px);
    opacity: 0;
  }
}

@media (max-width: 520px) {
  .divelog {
    gap: 8px;
    padding-left: 12px;
  }

  .divelog-kicker {
    display: none;
  }

  .divelog-text {
    font-size: 0.82rem;
  }
}

.tank-toast {
  position: fixed;
  left: 50%;
  top: 10px;
  z-index: 46;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 18px 8px 34px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.62);
  border: 1px solid rgba(240, 214, 150, 0.4);
  color: var(--foam);
  font: inherit;
  font-size: 0.88rem;
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 30px -6px rgba(240, 200, 120, 0.45);
  animation: toast-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tank-toast::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe8, #f0c878 60%, #c88a3a);
  box-shadow: 0 0 10px rgba(255, 210, 120, 0.9);
}

.tank-toast.is-gone {
  opacity: 0;
  transform: translate(-50%, -12px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -16px) scale(0.94);
  }
}

.dive-title {
  position: fixed;
  left: 50%;
  top: 46%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: dive-title 3.4s cubic-bezier(0.33, 0, 0.2, 1) 0.15s forwards;
}

.dive-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 560;
  letter-spacing: -0.01em;
  color: #f2fffc;
  text-shadow: 0 0 40px rgba(126, 224, 214, 0.55), 0 4px 30px rgba(0, 20, 30, 0.5);
}

.dive-line {
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(214, 246, 240, 0.82);
  text-shadow: 0 2px 14px rgba(0, 20, 30, 0.6);
}

body[data-tide="dusk"] .aquarium {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(232, 150, 90, 0.32), transparent 58%),
    radial-gradient(ellipse 45% 35% at 18% 78%, rgba(24, 92, 82, 0.28), transparent 70%),
    linear-gradient(180deg, #8a4a38 0%, #12384a 32%, #041e2a 72%, #021016 100%);
}

body[data-tide="dusk"] .light-rays {
  opacity: 0.55;
}

body[data-tide="night"] .aquarium {
  background:
    radial-gradient(circle at 78% 10%, rgba(230, 240, 255, 0.28) 0 1.5%, rgba(180, 210, 255, 0.08) 6%, transparent 18%),
    radial-gradient(ellipse 50% 40% at 78% 4%, rgba(180, 210, 255, 0.18), transparent 46%),
    linear-gradient(180deg, #061525 0%, #031018 40%, #01080e 100%);
}

body[data-tide="night"] .light-rays,
body[data-tide="night"] .caustics {
  opacity: 0.18;
}

body[data-tide="night"] .water-surface {
  opacity: 0.35;
}

body[data-tide="dusk"] .sand-prop-art {
  filter: brightness(1.04) saturate(1.08) drop-shadow(0 10px 8px rgba(8, 16, 14, 0.38));
}

body[data-tide="dusk"] .sand-prop.is-sleeping .sand-prop-art {
  filter: brightness(0.78) saturate(0.86) drop-shadow(0 10px 8px rgba(8, 16, 14, 0.38));
}

body[data-tide="night"] .sand-prop-art {
  filter: brightness(1.28) saturate(1.05) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
}

body[data-tide="night"] .sand-prop.is-sleeping .sand-prop-art {
  filter: brightness(0.95) saturate(0.85) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
}

body[data-tide="night"] .sand-prop-halo {
  mix-blend-mode: screen;
}

body[data-tide="night"] .sand-prop-label {
  background: rgba(4, 14, 22, 0.62);
}


/* Sonar: search palette */

.sonar-toggle {
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 5px 7px 5px 10px;
  border-radius: 999px;
  background: rgba(8, 32, 42, 0.28);
  border: 1px solid rgba(180, 230, 226, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--foam);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sonar-toggle:hover {
  background: rgba(20, 60, 72, 0.42);
  border-color: rgba(200, 245, 240, 0.32);
}

.sonar-glyph {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.4px solid var(--cyan);
  overflow: hidden;
}

.sonar-glyph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(126, 224, 214, 0.9), transparent 28%);
  animation: sonar-sweep 2.6s linear infinite;
}

.sonar-key,
.sonar-foot kbd,
.sonar-esc {
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid rgba(186, 232, 228, 0.22);
  background: rgba(186, 232, 228, 0.08);
  color: var(--mist);
}

.sonar {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(12vh, 76px) 16px 16px;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(2, 16, 22, 0.2), rgba(1, 8, 14, 0.55));
  animation: sonar-fade 0.2s ease both;
}

.sonar[hidden] {
  display: none;
}

.sonar-panel {
  --accent: #7ee0d6;
  position: relative;
  width: min(560px, 100%);
  max-height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  color: var(--foam);
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(126, 224, 214, 0.2), transparent 60%),
    linear-gradient(180deg, rgba(14, 52, 64, 0.72), rgba(4, 22, 32, 0.86));
  border: 1px solid rgba(196, 240, 236, 0.2);
  box-shadow:
    0 40px 90px -20px rgba(0, 6, 12, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  animation: sonar-rise 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sonar-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(186, 232, 228, 0.12);
}

.sonar-scope {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 32%, rgba(126, 224, 214, 0.32) 33% 36%, transparent 37% 64%, rgba(126, 224, 214, 0.26) 65% 68%, transparent 69%),
    rgba(4, 30, 38, 0.6);
  border: 1px solid rgba(126, 224, 214, 0.5);
  overflow: hidden;
}

.sonar-scope::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(126, 224, 214, 0.75), rgba(126, 224, 214, 0.08) 22%, transparent 30%);
  animation: sonar-sweep 2.2s linear infinite;
}

.sonar-scope span {
  position: absolute;
  left: 62%;
  top: 30%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e8fffb;
  box-shadow: 0 0 6px var(--cyan);
  animation: sonar-blip 2.2s linear infinite;
}

.sonar-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foam);
  font-size: 1.1rem;
  caret-color: var(--cyan);
}

.sonar-input::placeholder {
  color: rgba(197, 232, 225, 0.5);
}

.sonar-results {
  list-style: none;
  margin: 0;
  padding: 6px 8px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(186, 232, 228, 0.25) transparent;
}

.sonar-group {
  padding: 10px 10px 4px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(197, 232, 225, 0.55);
}

.sonar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.sonar-item.is-active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.sonar-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, rgba(4, 22, 30, 0.5));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

.sonar-icon svg {
  width: 17px;
  height: 17px;
}

.sonar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sonar-title {
  font-weight: 500;
}

.sonar-item.is-fish .sonar-title {
  text-transform: capitalize;
}

.sonar-sub {
  font-size: 0.78rem;
  color: rgba(197, 232, 225, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sonar-hint {
  flex: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.sonar-item.is-active .sonar-hint {
  opacity: 1;
}

.sonar-empty {
  padding: 22px 12px;
  text-align: center;
  color: rgba(197, 232, 225, 0.7);
}

.sonar-foot {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 10px 16px 12px;
  font-size: 0.72rem;
  color: rgba(197, 232, 225, 0.6);
  border-top: 1px solid rgba(186, 232, 228, 0.1);
}

.sonar-foot span:last-child {
  margin-left: auto;
}

.sonar-foot kbd {
  margin-right: 3px;
  padding: 0 5px;
}

@keyframes sonar-sweep {
  to { transform: rotate(1turn); }
}

@keyframes sonar-blip {
  0%, 18% { opacity: 0; }
  24% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

@keyframes sonar-fade {
  from { opacity: 0; }
}

@keyframes sonar-rise {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

.sonar-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

/* Night lantern: the tank darkens except around the cursor */

.night-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  background: radial-gradient(
    circle 320px at var(--lx, 50%) var(--ly, 45%),
    rgba(255, 214, 150, 0.16),
    rgba(255, 196, 120, 0.05) 28%,
    rgba(1, 5, 12, 0.4) 70%,
    rgba(1, 5, 12, 0.64) 100%
  );
}

body[data-tide="night"] .night-veil.is-lit {
  opacity: 1;
}

/* Field Guide */

.app-guide {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 2px;
}

.guide-head {
  display: grid;
  gap: 6px;
}

.guide-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent, var(--cyan));
}

.guide-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 650;
}

.guide-count {
  color: #fff6d8;
  text-shadow: 0 0 18px rgba(255, 220, 140, 0.45);
}

.guide-meter,
.guide-step {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(186, 232, 228, 0.12);
  overflow: hidden;
}

.guide-meter span,
.guide-step span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee0d6, #a8c4ff 60%, #f0c878);
  box-shadow: 0 0 12px rgba(168, 196, 255, 0.6);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-help {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: rgba(197, 232, 225, 0.72);
}

.guide-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.guide-line {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px rgba(200, 240, 236, 0.1);
}

.guide-forms {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.guide-forms::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 32px;
  border-top: 1px dashed rgba(186, 232, 228, 0.18);
}

.guide-form {
  position: relative;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.guide-form canvas {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 224, 214, 0.08), rgba(4, 22, 30, 0.35) 70%);
  box-shadow: inset 0 0 0 1px rgba(186, 232, 228, 0.1);
}

.guide-form.is-found canvas {
  background: radial-gradient(circle, rgba(168, 196, 255, 0.18), rgba(4, 22, 30, 0.3) 70%);
}

.guide-form.is-current canvas {
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--accent, #a8c4ff) 80%, transparent),
    0 0 18px -2px color-mix(in srgb, var(--accent, #a8c4ff) 55%, transparent);
}

.guide-form figcaption {
  font-size: 0.74rem;
  text-transform: capitalize;
  color: rgba(197, 232, 225, 0.5);
  white-space: nowrap;
}

.guide-form.is-found figcaption {
  color: var(--foam);
}

.guide-form.is-current figcaption {
  font-weight: 600;
  color: #fff6d8;
}

.guide-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 12px;
}

.guide-now {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(197, 232, 225, 0.8);
}

.guide-now strong {
  font-weight: 600;
  color: var(--foam);
  text-transform: capitalize;
}

.guide-now em {
  font-style: normal;
  color: #f0c878;
}

.guide-step {
  grid-column: 1;
  height: 4px;
}

.guide-ping {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--foam);
  border: 1px solid rgba(126, 224, 214, 0.35);
  background: rgba(126, 224, 214, 0.1);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.guide-ping svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

.guide-ping:hover {
  background: rgba(126, 224, 214, 0.2);
  border-color: rgba(126, 224, 214, 0.6);
}

.guide-ping:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 520px) {
  .sonar-foot span:nth-child(-n + 2) {
    display: none;
  }

  .guide-form canvas {
    width: 52px !important;
    height: 52px !important;
  }

  .guide-forms::before {
    top: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aquarium,
  .feed-cue b,
  .divelog,
  .divelog-text,
  .divelog-dots i,
  .feed-cue span,
  .feed-cue i,
  .sonar,
  .sonar-panel,
  .sonar-glyph::after,
  .sonar-scope::after,
  .sonar-scope span,
  .night-veil,
  .guide-meter span,
  .guide-step span,
  body,
  .window,
  .window.is-closing,
  .sand-prop,
  .sand-prop-art,
  .sand-prop-halo,
  .sand-prop-sleep,
  .calc-keys button,
  .music-eq span,
  .music-disc,
  .menubar,
  .tank-toast,
  .window::after,
  .light-rays,
  .caustics,
  .coral .star {
    animation: none !important;
    transition: none !important;
  }

  .dive-title {
    display: none;
  }

  body {
    opacity: 1;
  }

  .window {
    opacity: 1;
    transform: none;
  }

  .sand-prop,
  body.is-ready .sand-prop {
    opacity: 1;
    transform: translateY(var(--bury, 8px));
  }
}
