/* =========================================================
   🌊 DORUTILS ASCII AQUARIUM BACKGROUND
   =========================================================

   Full-page animated ASCII aquarium.
   No wrapper. No frame. No card.

   Core systems:
   01. Full-screen ocean background
   02. ASCII fish / shark / swordfish objects
   03. Z-depth layers
   04. Bubbles
   05. Seaweed
   06. Settings popup

   ========================================================= */
/* #region 01. GLOBAL RESET */
/* existing reset code */
/* #endregion */

/* #region 02. FULL PAGE AQUARIUM */
/* .aquarium, ::before, ::after */
/* #endregion */

/* #region 03. ASCII BASE + LIVING FISH */
/* .ascii, puffer, ascii-creature */
/* #endregion */

/* #region 04. DEPTH LAYERS */
/* depth-1 to depth-5 */
/* #endregion */

/* #region 05. COLOR TINTS */
/* tint classes */
/* #endregion */

/* #region 06. MOVEMENT ANIMATIONS */
/* swim-right, swim-left, pufferPulse */
/* #endregion */

/* #region 07. BUBBLES */
/* bubble styles */
/* #endregion */

/* #region 08. SEAWEED + SAND */
/* seaweed, coral, sand */
/* #endregion */

/* #region 09. SETTINGS POPUP */
/* settings panel, controls, fish picker, sectors */
/* #endregion */

/* #region 10. RESPONSIVE */
/* media queries */
/* #endregion */

/* =========================================================
   01. GLOBAL RESET
   ========================================================= */
/* #region 01. GLOBAL RESET */
/* existing reset code */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: #d9fbff;
  font-family: Consolas, "Courier New", monospace;
  background: #061522;
}

/* #endregion */

/* =========================================================
   02. FULL PAGE AQUARIUM
   ========================================================= */

.aquarium {
  --water-light: rgba(83, 185, 255, 0.38);
  --water-mid: #0e3f66;
  --water-deep: #03111f;

  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;

  background:
    radial-gradient(circle at 50% -10%, var(--water-light), transparent 38%),
    radial-gradient(circle at 18% 25%, rgba(40, 165, 210, 0.20), transparent 28%),
    radial-gradient(circle at 80% 55%, rgba(10, 80, 130, 0.25), transparent 35%),
    linear-gradient(to bottom, var(--water-mid) 0%, #072841 45%, var(--water-deep) 100%);
}

/* Soft light rays */
.aquarium::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(105deg, transparent 0 20%, rgba(255, 255, 255, 0.045) 22%, transparent 30%),
    linear-gradient(118deg, transparent 0 42%, rgba(255, 255, 255, 0.035) 44%, transparent 52%),
    linear-gradient(92deg, transparent 0 65%, rgba(255, 255, 255, 0.025) 67%, transparent 75%);
  animation: water-rays 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

/* Dark depth vignette */
.aquarium::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.12) 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 90;
}

@keyframes water-rays {
  from {
    transform: translateX(-3%) rotate(-1deg);
    opacity: 0.7;
  }

  to {
    transform: translateX(3%) rotate(1deg);
    opacity: 1;
  }
}


/* =========================================================
   03. ASCII BASE OBJECT
   ========================================================= */

.ascii {
  position: absolute;
  white-space: pre;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 0 8px currentColor;
  will-change: transform;

  /* Should Fix Broken ASCII alignments */
  font-variant-ligatures: none;
  letter-spacing: 0;
}

/*  CLICKABLE FISHES INTERACTION  ( PUFFERFISH )  */
/* puffer swims normally
after random delay -> gets puffed
only then click works
click -> POP! + returns normal*/
.clickable-fish {
  pointer-events: auto;
  cursor: pointer;
}

.puffer-fish.puffed {
  font-size: 0.75em;
  line-height: 1;
  letter-spacing: 0;
  filter: drop-shadow(0 0 18px currentColor);
  z-index: 60;
}

.pop-text {
  position: absolute;
  color: #fff4a8;
  font-size: 18px;
  font-weight: bold;
  z-index: 80;
  animation: pop-float 0.7s ease-out forwards;
}

@keyframes pop-float {
  from {
    transform: translateY(0) scale(0.8);
    opacity: 1;
  }

  to {
    transform: translateY(-28px) scale(1.2);
    opacity: 0;
  }
}

/* ADDED LIVING FISH V1 */
.ascii-creature {
  position: absolute;
  width: 150px;
  height: 44px;
  white-space: pre;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 0 12px currentColor;
  will-change: transform;
  z-index: 45;
  font-size: 22px;
  filter: drop-shadow(0 0 10px currentColor);
}

.ascii-creature pre {
  position: absolute;
  margin: 0;
}

.creature-body {
  left: 42px;
  top: 10px;
}

.creature-trail {
  left: 0;
  top: 12px;
  opacity: 0.35;
  font-size: 16px;
  animation: trail-fade 1.2s infinite alternate;
}

.creature-fin {
  left: 86px;
  top: 25px;
  font-size: 16px;
  animation: fin-wiggle 0.45s infinite alternate;
}

/* =========================================================
   04. DEPTH LAYERS
   ---------------------------------------------------------
   depth-1 = far / dark / small / blurry
   depth-5 = close / bright / larger / sharp
   ========================================================= */

.depth-1 {
  opacity: 0.28;
  font-size: 12px;
  filter: blur(1.6px) saturate(0.65);
  z-index: 5;
}

.depth-2 {
  opacity: 0.45;
  font-size: 14px;
  filter: blur(0.9px) saturate(0.78);
  z-index: 8;
}

.depth-3 {
  opacity: 0.68;
  font-size: 16px;
  filter: blur(0.35px) saturate(0.95);
  z-index: 12;
}

.depth-4 {
  opacity: 0.86;
  font-size: 18px;
  filter: blur(0) saturate(1.1);
  z-index: 16;
}

.depth-5 {
  opacity: 1;
  font-size: 21px;
  filter: blur(0) saturate(1.3) drop-shadow(0 0 10px currentColor);
  z-index: 22;
}


/* =========================================================
   05. SPECIES COLOR TINTS
   ========================================================= */

.tint-yellow {
  color: #fff4a8;
}

.tint-pink {
  color: #ffc1df;
}

.tint-blue {
  color: #9ee7ff;
}

.tint-silver {
  color: #d7f7ff;
}

.tint-shark {
  color: #cfd8dc;
}

.tint-green {
  color: #4dff9a;
}

.tint-orange {
  color: #ffbf69;
}

.tint-cyan {
  color: #8ef6ff;
}

.tint-purple {
  color: #c9a7ff;
}

.tint-red {
  color: #ff8a8a;
}

.tint-lime {
  color: #b6ff7a;
}



/* =========================================================
   06. MOVEMENT ANIMATIONS
   ========================================================= */

.flip-fish {
  scale: -1 1;
}

.swim-right {
  left: 0;
  animation-name: swim-right;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.swim-left {
  left: 0;
  animation-name: swim-left;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/*  Better movement - fix dis/Appearing mid screen  */
@keyframes swim-right {
  from { transform: translateX(-2000px); }
  to   { transform: translateX(calc(100vw + 2000px)); }
}

@keyframes swim-left {
  from { transform: translateX(calc(100vw + 2000px)) scaleX(-1); }
  to   { transform: translateX(-2000px) scaleX(-1); }
}

/* PUFFER FISH ANIMATIONS */
.puffer-fish {
  animation-name: inherit, pufferPulse;
  animation-duration: inherit, 2.5s;
  animation-iteration-count: infinite, infinite;
}

@keyframes pufferPulse {

  0%,
  100% {
    letter-spacing: 0;
  }

  50% {
    letter-spacing: 2px;
  }
}


/* =========================================================
   07. BUBBLES
   ========================================================= */

.bubble {
  position: absolute;
  bottom: -40px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(210, 245, 255, 0.55);
  border-radius: 50%;
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.35),
    0 0 12px rgba(110, 220, 255, 0.18);
  animation-name: bubble-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
  z-index: 6;
}

.bubble::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}

@keyframes bubble-rise {
  0% {
    transform: translateY(0) translateX(0) scale(0.6);
    opacity: 0;
  }

  12% {
    opacity: 0.65;
  }

  100% {
    transform: translateY(-115vh) translateX(45px) scale(1.35);
    opacity: 0;
  }
}


/* =========================================================
   08. SEAWEED / BOTTOM DECOR
   ========================================================= */

.seaweed {
  bottom: -12px;
  color: #4dff9a;
  transform-origin: bottom center;
  animation-name: seaweed-sway;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  z-index: 20;
}

.seaweed.deep {
  opacity: 0.45;
  color: #2a9e70;
  filter: blur(1px);
  z-index: 7;
}

.seaweed-classic {
  color: #4dff9a;
}

.seaweed-curly {
  color: #2dff88;
}

.seaweed-tall {
  color: #35e98a;
  font-size: 24px;
}

.seaweed-long {
  color: #3cff99;
  font-size: 28px;
}

.seaweed-wave {
  color: #28c978;
}

.coral-pink {
  color: #ff8fab;
  font-size: 18px;
}

.coral-orange {
  color: #ffb86b;
  font-size: 18px;
}

@keyframes seaweed-sway {
  from {
    transform: rotate(-3deg) translateY(0);
  }

  to {
    transform: rotate(4deg) translateY(-8px);
  }
}

/* Sand Colors : */
.sand-patch {
  bottom: 0;
  color: #d6b46c;
  opacity: 0.32;
  font-size: 11px;
  z-index: 3;
  filter: blur(0.2px);
}

/* =========================================================
   09. SETTINGS POPUP
   ========================================================= */

.settings-toggle {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 120;
  border: 1px solid rgba(190, 240, 255, 0.25);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(3, 20, 35, 0.55);
  color: #d9fbff;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
}

.settings-toggle:hover {
  border-color: rgba(190, 240, 255, 0.55);
  background: rgba(3, 20, 35, 0.72);
}

.settings-panel {
  position: fixed;
  right: 22px;
  top: 72px;
  width: 320px;
  z-index: 130;
  padding: 18px;
  border-radius: 22px;
  background: rgba(3, 20, 35, 0.78);
  border: 1px solid rgba(190, 240, 255, 0.22);
  color: #d9fbff;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transform: translateX(120%);
  opacity: 0;
  transition: 0.25s ease;
  /* added for scrollable popup */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.settings-panel.open {
  transform: translateX(0);
  opacity: 1;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-header h2 {
  margin: 0;
  font-size: 1rem;
}

.close-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  margin: 14px 0;
  font-size: 0.9rem;
}

.control-row input {
  grid-column: 1 / -1;
  width: 100%;
}

.value-pill {
  min-width: 46px;
  padding: 3px 8px;
  border-radius: 999px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.8rem;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.panel-btn {
  flex: 1;
  border: 1px solid rgba(190, 240, 255, 0.22);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(120, 220, 255, 0.15);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.panel-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.settings-note {
  margin: 14px 0 0;
  opacity: 0.75;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Fish Picker */
.fish-picker {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid rgba(190, 240, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.fish-picker summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 10px;
}

.fish-toggle-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.fish-toggle-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.fish-toggle-item label {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.fish-preview {
  margin: 0;
  opacity: 0.8;
  font-size: 0.75rem;
  line-height: 1;
  white-space: pre;
}

.settings-sector {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid rgba(190, 240, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.settings-sector summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 10px;
}


/* =========================================================
   10. RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {
  .settings-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .settings-toggle {
    right: 16px;
    top: 16px;
  }
}