/* Bayang — maskot mengambang. Mirror js/mascot.js
   .mascot adalah jangkar posisi (lebar/tinggi = ukuran sprite); bubble dan
   menu masing-masing absolute relatif ke jangkar ini, di sisi yang beda
   (bubble di atas, menu di kiri) supaya keduanya gak pernah tumpuk. */

.mascot {
  position: fixed;
  bottom: 18px;
  right: 24px;
  z-index: 60;
  width: 68px;
  height: 84px;
  transition: right 1.1s cubic-bezier(0.65, 0, 0.35, 1), bottom 1.1s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}

.mascot.is-manual {
  transition: right 140ms ease, bottom 140ms ease;
}

.mascot__sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/mascot.png') center / contain no-repeat;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  animation: mascot-float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.mascot.is-walking .mascot__sprite,
.mascot.is-manual .mascot__sprite {
  animation: mascot-walk 0.4s ease-in-out infinite;
}

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

@keyframes mascot-walk {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.mascot__bubble {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  width: 230px;
  background: var(--panel-raised);
  border: 1px solid var(--accent-green-dim);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.mascot__bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mascot__bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 26px;
  width: 12px;
  height: 12px;
  background: var(--panel-raised);
  border-right: 1px solid var(--accent-green-dim);
  border-bottom: 1px solid var(--accent-green-dim);
  transform: rotate(45deg);
}

.mascot__menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.mascot__menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mascot__menu-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.mascot__menu-item:hover {
  background: var(--accent-green-dim);
  color: var(--text);
}

@media (max-width: 560px) {
  .mascot { width: 52px; height: 64px; }
  .mascot__bubble { width: 180px; font-size: 0.8rem; }
}
