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

body {
  background: #0a0604;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: system-ui, sans-serif;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;   /* tracks the collapsing mobile URL bar */
  position: fixed;
  top: 0; left: 0;
  z-index: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}



/* ── Vignette overlay ── */
#vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,5,0.6) 100%);
}

/* ── Fish nameplate (hover) ── */
#nameplate {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  background: rgba(8, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 4px 10px;
  color: rgba(210, 235, 255, 0.92);
  font-size: 12px;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
#nameplate.visible { opacity: 1; }
#nameplate .trait { color: rgba(140, 190, 230, 0.65); font-size: 10px; margin-left: 6px; }

/* ── Controls bar ── */
#controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 15, 25, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 8px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.ctrl-label {
  color: rgba(185, 220, 255, 0.50);
  font-size: 11px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.ctrl-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

/* Slider */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(99, 215, 202, 0.90);
  cursor: pointer;
  transition: background 0.15s;
}
input[type=range]:hover::-webkit-slider-thumb {
  background: rgba(99, 215, 202, 1.0);
}
input[type=range]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: rgba(99, 215, 202, 0.90);
  cursor: pointer;
}

/* Icon buttons */
.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(185, 220, 255, 0.62);
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(210, 235, 255, 0.90);
}
.icon-btn.active {
  background: rgba(99, 215, 202, 0.15);
  border-color: rgba(99, 215, 202, 0.35);
  color: rgba(99, 215, 202, 0.95);
}

/* ── Screensaver mode: hide cursor + UI after 3s of inactivity ── */
body.screensaver { cursor: none; }
body.screensaver #controls { opacity: 0; pointer-events: none; transition: opacity 0.6s; }

/* ── Mobile layout ── */
@media (max-width: 600px) {
  #controls {
    bottom: 40px;
    right: 50%;
    transform: translateX(50%);
    padding: 10px 16px;
  }
  .icon-btn {
    font-size: 15px;
    padding: 8px 14px;   /* finger-sized targets */
  }
  input[type=range] {
    width: 110px;
    height: 5px;
  }
  input[type=range]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
}
