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

body {
  background: #1a1a2e;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Title */
#title-canvas {
  margin-top: 60px;
  image-rendering: pixelated;
}

/* Water */
.water-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to bottom, transparent, rgba(30, 80, 140, 0.15));
  pointer-events: none;
}

/* Duck */
#duck-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Ripple */
#ripple-canvas {
  position: absolute;
  top: calc(50% + 100px);
  left: 50%;
  transform: translateX(-50%);
  image-rendering: pixelated;
  opacity: 0.4;
}

/* Stars */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  opacity: 0;
  animation: twinkle 3s infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.8; }
}

/* Облачко с текстом (комикс) */
.speech-bubble {
  position: absolute;
  padding: 12px 18px;
  background: #fff;
  border: 3px solid #333;
  border-radius: 20px;
  font-family: 'Comic Sans MS', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #1a1a2e;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 0) scale(0);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10;
}

/* Хвостик облачка — три кружка вниз к утке */
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid #fff;
  filter: drop-shadow(0 2px 0 #333);
}

.speech-bubble.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
