/*
 * Fish tank container: background image, optional mask, bubbles.
 */

.tank {
  width: var(--container-width);
  max-width: 100%;
  height: var(--tank-height, 600px);
  background-color: var(--color-section-bg, #0d2a1e);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--container-radius);
  overflow: hidden;
  position: relative;
}

/* When aspect-ratio is set inline, height is auto-computed from width */
.tank[style*="aspect-ratio"] {
  height: auto;
}

.tank[style*="mask-image"] {
  mask-size: cover;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-size: cover;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
}

.tank-title {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--font-tank-label, "Dancing Script", cursive);
  font-size: var(--tank-label-font-size, 1rem);
  color: var(--color-accent-gold);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.tank-bubbles-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.tank-fish-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tank-fish {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.tank-fish.fish-rainbow {
  animation: fish-rainbow-hue var(--fish-rainbow-duration, 3s) linear var(--fish-rainbow-delay, 0s) infinite;
}

.tank-fish-wrapper.fish-rainbow {
  animation: fish-rainbow-scale var(--fish-rainbow-duration, 3s) linear var(--fish-rainbow-delay, 0s) infinite;
}

@keyframes fish-rainbow-hue {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

@keyframes fish-rainbow-scale {
  0%, 100% { transform: scale(0.85); }
  50% { transform: scale(1.15); }
}

.tank-project-icon {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation; /* Reduces 300ms tap delay, improves mobile responsiveness */
}

@media (max-width: 767px) {
  .tank {
    width: var(--container-width-mobile);
  }
}
