.planck-pet {
  position: fixed;
  z-index: 40;
  left: 0;
  bottom: max(4px, env(safe-area-inset-bottom));
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  isolation: isolate;
  will-change: transform;
  transition: opacity 220ms ease;
}

.planck-pet.is-ready {
  opacity: 1;
}

.planck-pet__character {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 7px 8px rgba(12, 14, 18, 0.2));
}

.planck-pet__character:focus-visible {
  outline: 2px solid var(--blue, #1d71b8);
  outline-offset: 3px;
  border-radius: 12px;
}

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

.planck-pet__control {
  position: absolute;
  top: -30px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border, #e6e8ec);
  border-radius: 999px;
  background: var(--card, #fff);
  color: var(--muted, #6b7280);
  box-shadow: var(--shadow, 0 8px 24px rgba(16, 24, 40, 0.12));
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.planck-pet:hover .planck-pet__control,
.planck-pet:focus-within .planck-pet__control,
.planck-pet.is-paused .planck-pet__control {
  opacity: 0.92;
  transform: translateY(0);
}

.planck-pet__control:hover,
.planck-pet__control:focus-visible {
  color: var(--blue, #1d71b8);
  border-color: var(--blue, #1d71b8);
  outline: none;
}

.planck-pet__control:focus-visible {
  outline: 2px solid var(--blue, #1d71b8);
  outline-offset: 2px;
}

@media (max-width: 600px), (hover: none) {
  .planck-pet__control {
    top: -25px;
    width: 25px;
    height: 25px;
    opacity: 0.72;
    transform: none;
  }
}

@media print {
  .planck-pet {
    display: none !important;
  }
}
