.cat-pet {
  --pet-size: 214px;
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 80;
  width: var(--pet-size);
  pointer-events: none;
  user-select: none;
  touch-action: none;
}

.cat-pet__character,
.cat-pet__close,
.cat-pet__menu-item {
  border: 0;
  font: inherit;
}

.cat-pet__character {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.34));
  transform-origin: 50% 100%;
}

.cat-pet__character:active {
  cursor: grabbing;
}

.cat-pet__character:focus-visible,
.cat-pet__close:focus-visible {
  outline: 2px solid #ffad63;
  outline-offset: 3px;
}

.cat-pet__canvas {
  display: block;
  width: 100%;
  height: auto;
}

.cat-pet__bubble {
  position: absolute;
  top: 6px;
  left: 50%;
  min-width: 76px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff6ec;
  background: rgba(12, 15, 23, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.cat-pet__bubble.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cat-pet__close {
  position: absolute;
  top: 22px;
  right: 1px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #d7d9e1;
  background: rgba(12, 15, 23, 0.82);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease;
}

.cat-pet:hover .cat-pet__close,
.cat-pet:focus-within .cat-pet__close {
  opacity: 1;
}

.cat-pet__close:hover {
  color: #fff;
  background: rgba(255, 120, 83, 0.92);
}

.cat-pet__menu {
  position: absolute;
  right: 10px;
  bottom: 72%;
  z-index: 4;
  display: none;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 5px;
  width: 184px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(12, 15, 23, 0.94);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.cat-pet__menu.is-open {
  display: grid;
}

.cat-pet__menu-item {
  padding: 7px 8px;
  border-radius: 9px;
  color: #f6eee6;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.cat-pet__menu-item:hover,
.cat-pet__menu-item:focus-visible {
  color: #19151a;
  background: #ffb875;
  outline: none;
}

@media (max-width: 700px) {
  .cat-pet {
    --pet-size: 142px;
    right: 5px;
    bottom: 4px;
  }

  .cat-pet__bubble {
    top: 0;
    padding: 6px 9px;
    font-size: 11px;
  }

  .cat-pet__close {
    top: 18px;
    width: 26px;
    height: 26px;
    opacity: 0.75;
  }

  .cat-pet__menu {
    right: 0;
    bottom: 80%;
    width: 176px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-pet__bubble,
  .cat-pet__close {
    transition: none;
  }
}
