:root {
  --dotol-cat-size: clamp(76px, 18vw, 116px);
}

.dotol-cat {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  width: var(--dotol-cat-size);
  height: calc(var(--dotol-cat-size) * 1.083333);
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
  transform: translate3d(var(--dotol-cat-x, 24px), var(--dotol-cat-y, 360px), 0);
  transition: filter 160ms ease;
}

.dotol-cat:focus-visible {
  outline: 2px solid rgba(255, 183, 3, 0.9);
  outline-offset: 6px;
  border-radius: 12px;
}

.dotol-cat__sprite {
  position: absolute;
  inset: 0;
  background-image: url("nabi-spritesheet.webp?v=3");
  background-repeat: no-repeat;
  background-size: 800% 900%;
  background-position: var(--dotol-pet-bg-x, 0%) var(--dotol-pet-bg-y, 0%);
  pointer-events: auto;
}

.dotol-cat__shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 2%;
  height: 9%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  transform: scaleX(1);
  transition: opacity 140ms ease, transform 140ms ease;
}

.dotol-cat__bubble {
  position: absolute;
  left: 50%;
  bottom: 88%;
  max-width: 150px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(26, 29, 37, 0.94);
  color: #fff7df;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.92);
  transition: opacity 140ms ease, transform 140ms ease;
}

.dotol-cat__bubble.is-showing {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.dotol-cat.is-petting .dotol-cat__sprite {
  animation: dotol-pet-hop 420ms ease;
}

.dotol-cat.is-held {
  cursor: grabbing;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.24));
}

.dotol-cat.is-held .dotol-cat__sprite {
  transform: translateY(-7%) rotate(4deg) scale(1.04);
}

.dotol-cat.is-held .dotol-cat__shadow {
  opacity: 0.13;
  transform: translateY(18px) scale(0.7);
}

@keyframes dotol-pet-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-11%) scale(1.05, 0.94); }
}

@media (prefers-reduced-motion: reduce) {
  .dotol-cat,
  .dotol-cat *,
  .dotol-cat__bubble {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
