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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow: hidden;
  height: 100vh;
  background: linear-gradient(to bottom, #001F3F 0%, #003D7A 30%, #0066B3 60%, #0080CC 100%);
}

.ocean {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-repeat: repeat-x;
  animation: wave 15s linear infinite;
  opacity: 0.4;
}

.wave1 {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,50 Q300,100 600,50 T1200,50 L1200,120 L0,120 Z" fill="%23ffffff"/></svg>');
  background-size: 1200px 120px;
  animation-duration: 18s;
  bottom: 0;
  height: 120px;
  opacity: 0.3;
}

.wave2 {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,70 Q300,20 600,70 T1200,70 L1200,120 L0,120 Z" fill="%23ffffff"/></svg>');
  background-size: 1200px 120px;
  animation-duration: 15s;
  animation-delay: -5s;
  bottom: 10px;
  height: 120px;
  opacity: 0.25;
}

.wave3 {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,60 Q300,90 600,60 T1200,60 L1200,120 L0,120 Z" fill="%23ffffff"/></svg>');
  background-size: 1200px 120px;
  animation-duration: 12s;
  animation-delay: -2s;
  bottom: 20px;
  height: 120px;
  opacity: 0.2;
}

.wave4 {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,80 Q300,40 600,80 T1200,80 L1200,120 L0,120 Z" fill="%23ffffff"/></svg>');
  background-size: 1200px 120px;
  animation-duration: 20s;
  animation-delay: -8s;
  bottom: 30px;
  height: 120px;
  opacity: 0.15;
}

@keyframes wave {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  color: white;
}

.whale-container {
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.whale-image {
  max-width: 300px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.play-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.play-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.play-button:active {
  transform: scale(0.98);
}

/* Bubbles animation */
body::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 2%),
    radial-gradient(circle at 60% 90%, rgba(255, 255, 255, 0.1) 0%, transparent 2%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 2%),
    radial-gradient(circle at 40% 85%, rgba(255, 255, 255, 0.1) 0%, transparent 2%),
    radial-gradient(circle at 90% 95%, rgba(255, 255, 255, 0.1) 0%, transparent 2%);
  background-size: 100% 100%;
  animation: bubbles 10s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bubbles {
  0%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-30px);
  }
}

/* Storm Toggle */
.storm-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

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

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  border-radius: 26px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

input[type="checkbox"]:checked + .toggle-slider {
  background: rgba(100, 100, 100, 0.4);
}

input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-text {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Stormy Ocean */
body.stormy {
  background: linear-gradient(to bottom, #0a0a0a 0%, #1a1a2e 30%, #16213e 60%, #0f3460 100%);
  transition: background 1s ease;
}

body.stormy .wave {
  animation-duration: 3s !important;
}

body.stormy .wave1 {
  animation-duration: 4s !important;
  opacity: 0.5;
  filter: brightness(0.7);
}

body.stormy .wave2 {
  animation-duration: 3s !important;
  opacity: 0.4;
  filter: brightness(0.7);
}

body.stormy .wave3 {
  animation-duration: 2.5s !important;
  opacity: 0.35;
  filter: brightness(0.7);
}

body.stormy .wave4 {
  animation-duration: 3.5s !important;
  opacity: 0.3;
  filter: brightness(0.7);
}

/* Rain effect for stormy mode */
body.stormy::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(transparent 0%, transparent 50%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 2px 20px;
  animation: rain 0.3s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes rain {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 20px;
  }
}

/* Lightning flashes */
body.stormy {
  animation: lightning 8s ease-in-out infinite;
}

@keyframes lightning {
  0%, 100% {
    filter: brightness(1);
  }
  45%, 55%, 65% {
    filter: brightness(1);
  }
  48%, 52% {
    filter: brightness(1.8);
  }
  50% {
    filter: brightness(2.5);
  }
  62%, 68% {
    filter: brightness(1.5);
  }
}

/* Make whale more turbulent in storm */
body.stormy .whale-container {
  animation: stormFloat 1.5s ease-in-out infinite;
}

@keyframes stormFloat {
  0%, 100% {
    transform: translateY(0) rotate(-5deg);
  }
  25% {
    transform: translateY(-30px) rotate(5deg);
  }
  50% {
    transform: translateY(-10px) rotate(-3deg);
  }
  75% {
    transform: translateY(-25px) rotate(3deg);
  }
}
