/* ============================================================
   duck-life.css — Floating Duck Lifecycle Widget
   Pasangkan dengan duck-life.js
   ============================================================ */

/* ── Wrapper — mobile only ── */
#bonekWrap {
  display: none;
  position: fixed;
  bottom: 120px;
  right: 0;
  z-index: 499;
  width: 100px;
  height: 180px;
  overflow: hidden;
  pointer-events: none;
}

/* ── Karakter bebek — posisi awal tersembunyi, naik saat .peek ── */
#bonekChar {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  transition: bottom 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
  user-select: none;
}

#bonekChar svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(-3px 0 12px rgba(245, 200, 0, 0.45));
}

/* ── Animasi mata kedip ── */
@keyframes duckBlink {
  0%,
  88%,
  100% {
    transform: scaleY(1);
  }
  93% {
    transform: scaleY(0.15);
  }
}
.bonek-eye {
  animation: duckBlink 4s ease-in-out infinite;
  transform-origin: center center;
}
.bonek-eye-r {
  animation-delay: 0.1s;
}

/* ── Animasi goyang kepala saat ngintip ── */
@keyframes duckLook {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) rotate(-4deg);
  }
  50% {
    transform: translateX(-50%) rotate(3.5deg);
  }
  75% {
    transform: translateX(-50%) rotate(-3deg);
  }
}

/* ── State .peek — bebek naik & goyang ── */
#bonekWrap.peek #bonekChar {
  bottom: 5px;
  animation: duckLook 3.2s 0.3s ease-in-out infinite;
}

/* ── Speech bubble — mobile only ── */
#bonekBubble {
  display: none;
  position: fixed;
  bottom: 230px;
  right: 16px;
  z-index: 498;
  background: #fff;
  border: 1.5px solid rgba(245, 200, 0, 0.5);
  border-radius: 14px 14px 4px 14px;
  padding: 8px 13px;
  font-family: "Syne", sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #0d0a00;
  white-space: normal;
  max-width: 200px;
  text-align: right;
  line-height: 1.5;
  box-shadow: 0 4px 18px rgba(245, 200, 0, 0.22);
  opacity: 0;
  transform: scale(0.7) translateY(8px);
  transform-origin: bottom right;
  transition:
    opacity 0.3s 0.4s ease,
    transform 0.35s 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}
#bonekBubble.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Tampil hanya di mobile ── */
@media (max-width: 900px) {
  #bonekWrap {
    display: block;
  }
  #bonekBubble {
    display: block;
  }
}
