/* CNQ AI Pet Widget — bottom-right corner companion */

#cnq-pet {
  position: fixed;
  bottom: calc(var(--dock-height, 78px) + var(--dock-safe, 10px) + 14px);
  right: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateY(220px);
  opacity: 0;
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .4s ease;
}

#cnq-pet.pet-visible {
  transform: translateY(0);
  opacity: 1;
}

/* ── Speech bubble ─────────────────────────────────────── */
#cnq-pet-bubble {
  position: relative;
  background: rgba(14, 14, 14, .92);
  color: #f0f0f0;
  font-family: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  padding: 9px 14px;
  border-radius: 12px;
  max-width: 190px;
  min-width: 80px;
  text-align: center;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  margin-bottom: 9px;
  pointer-events: none;
  user-select: none;
  /* start hidden */
  transform: scale(.6) translateY(8px);
  transform-origin: bottom center;
  opacity: 0;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .22s ease;
}

/* downward triangle pointer */
#cnq-pet-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(14, 14, 14, .92);
  border-bottom-width: 0;
}

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

/* ── Main black box ────────────────────────────────────── */
#cnq-pet-box {
  width: 110px;
  height: 110px;
  background: #0b0b0b;
  border-radius: 20px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, .55),
    0 3px 10px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

#cnq-pet-box:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .6),
    0 4px 14px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

#cnq-pet-box:active {
  transform: scale(.97);
}

#cnq-pet-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* disable drag + right-click saving */
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* notification badge */
#cnq-pet-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 18px;
  height: 18px;
  background: #ff3b30;
  border-radius: 50%;
  color: #fff;
  font-family: "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 59, 48, .5);
  opacity: 0;
  transform: scale(0);
  transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
  z-index: 2;
}

#cnq-pet-badge.badge-show {
  opacity: 1;
  transform: scale(1);
}

/* mobile: shrink slightly and shift left of the mobile FAB */
@media (max-width: 700px) {
  #cnq-pet {
    right: 6px;
    bottom: calc(var(--dock-height, 70px) + var(--dock-safe, 10px) + 10px);
  }
  #cnq-pet-box {
    width: 90px;
    height: 90px;
    border-radius: 16px;
  }
  #cnq-pet-bubble {
    font-size: 11.5px;
    max-width: 160px;
  }
}
