/* Desk Pet — Scoped to .desk-pet layer; host page keeps its own body styles. */

.desk-pet {
  position: fixed;
  inset: 0;
  z-index: 55;
  overflow: hidden;
  pointer-events: none;
}

.desk-pet__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  pointer-events: none;
}

.desk-pet__pet {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  z-index: 50;
  cursor: grab;
  user-select: none;
  pointer-events: auto;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.desk-pet__pet:active {
  cursor: grabbing;
}

.desk-pet__pet::after {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 11px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.95), 0 0 5px rgba(15, 23, 42, 0.85);
  opacity: 0;
  transition: 0.2s;
  z-index: 51;
}

.desk-pet__pet[data-state="sleep"]::after {
  content: "Zzz";
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.95), 0 0 5px rgba(15, 23, 42, 0.85);
  opacity: 1;
  animation: pet-zzz 2s infinite linear;
}

.desk-pet__pet[data-state="angry"]::after {
  content: "!!";
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.95), 0 0 5px rgba(15, 23, 42, 0.85);
  opacity: 1;
  font-style: italic;
  animation: pet-startle 0.3s ease-out forwards;
}

@keyframes pet-zzz {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  20%, 80% { opacity: 1; }
  100% { transform: translate(-50%, -22px) scale(1.15); opacity: 0; }
}

@keyframes pet-startle {
  0% { transform: translate(-50%, 4px) scale(0.6); }
  100% { transform: translate(-50%, 0) scale(1.15); }
}

.desk-pet__gfx {
  width: 100%;
  height: 100%;
  background: center / contain no-repeat;
  transform-origin: center;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.35));
}

.desk-pet__dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 96px;
  height: 96px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.desk-pet__dock-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.desk-pet__dock.is-visible,
.desk-pet__dock.is-active {
  opacity: 1;
}

.desk-pet__dock.is-stowed {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 3px 10px rgba(71, 85, 105, 0.35));
}

.desk-pet__dock.is-target {
  filter: drop-shadow(0 0 14px rgba(71, 85, 105, 0.55));
}

/* Appearance condition disabled for now
@media (any-pointer: coarse) and (not (any-pointer: fine)) {
  .desk-pet {
    display: none !important;
  }
}
*/
