.mascot {
  --k: 1;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 900;
  width: calc(93px * var(--k));
  height: calc(76.5px * var(--k));
  transform: translate(-300px, -300px);
  transition-property: transform;
  transition-timing-function: linear;
  pointer-events: none;
}

.mascot.mascot-hidden {
  display: none;
}

.mascot-body {
  position: absolute;
  inset: 0;
  cursor: pointer;
  pointer-events: auto;
  background: none;
  border: 0;
  padding: 0;
}

.mascot-bob {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  animation: mascot-idle 1.6s ease-in-out infinite;
}

.mascot-sprite {
  width: 100%;
  height: 100%;
  background-image: url('../../images/mascot/axolotl_sprite.png');
  background-repeat: no-repeat;
  background-size: 1600% 100%;
  background-position: 0 0;
}

.mascot.mascot-left .mascot-sprite {
  transform: scaleX(-1);
}

.mascot.mascot-running .mascot-bob {
  animation: mascot-hop 0.3s ease-in-out infinite alternate;
}

.mascot.mascot-jump .mascot-bob {
  animation: mascot-jump 0.45s ease-out 1;
}

.mascot.mascot-asleep .mascot-bob {
  animation: mascot-breathe 2.6s ease-in-out infinite;
}

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

@keyframes mascot-hop {
  from {
    transform: translateY(0) rotate(-5deg);
  }
  to {
    transform: translateY(-7px) rotate(5deg);
  }
}

@keyframes mascot-jump {
  0% {
    transform: translateY(0) scale(1.06, 0.92);
  }
  40% {
    transform: translateY(-18px) scale(0.96, 1.05);
  }
  80% {
    transform: translateY(0) scale(1.05, 0.95);
  }
  100% {
    transform: translateY(0) scale(1, 1);
  }
}

@keyframes mascot-breathe {
  0%, 100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.03, 0.95);
  }
}

.mascot-bubble {
  position: absolute;
  right: calc(50% + 2px);
  bottom: calc(100% - 20px);
  max-width: 220px;
  width: max-content;
  padding: 8px 12px;
  border: 2px solid #2b0a2a;
  border-radius: 12px;
  background: #ffffff;
  color: #2b0a2a;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 3px 0 #2b0a2a;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -8px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 2px solid #2b0a2a;
  border-bottom: 2px solid #2b0a2a;
  transform: rotate(45deg);
}

.mascot-bubble.mascot-bubble-right {
  right: auto;
  left: calc(50% + 2px);
  transform-origin: bottom left;
}

.mascot-bubble.mascot-bubble-right::after {
  right: auto;
  left: 14px;
}

.mascot-bubble.mascot-bubble-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
  .mascot {
    --k: 0.8;
  }

  .mascot-bubble {
    max-width: 170px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot {
    transition: none !important;
  }

  .mascot-bob,
  .mascot.mascot-running .mascot-bob,
  .mascot.mascot-asleep .mascot-bob {
    animation: none !important;
  }
}
