/* Reserve space for the largest calibrated sprite, rather than overflowing into text.
   A common responsive base preserves ratios on narrow cards. Egg transforms stay separate. */
.pet-zone { height: 190px; position: relative; container-type: inline-size; overflow: hidden; }
.pet-zone img:not(.pet-egg) {
  width: calc(100px * var(--pet-scale, 1));
  height: calc(100px * var(--pet-scale, 1));
  max-width: none; max-height: none; object-fit: contain; flex-shrink: 0;
}

/* Detail: 60% larger calibrated canvas, with enough space for the entire image.
   Keep the source aspect ratio/transparent margins; never crop individual frames. */
#cards .card { cursor: pointer; }
#cards .card:focus-visible { outline: 2px solid #598463; outline-offset: 3px; }
#pet-detail { max-width: 760px; margin: 0 auto; }
#pet-detail .heading { flex-wrap: wrap; }
.detail-card { text-align: center; padding: clamp(16px, 4vw, 32px); }
.detail-card:hover { transform: none; }
.detail-card .card-top, .detail-card .pet-info { justify-content: center; flex-wrap: wrap; }
.detail-card .pet-zone { height: 300px; overflow: visible; background: radial-gradient(ellipse, #edf4e4, transparent 68%); }
.detail-card .pet-zone img:not(.pet-egg) {
  width: calc(160px * var(--pet-scale, 1));
  height: calc(160px * var(--pet-scale, 1));
}
.detail-card .pet-zone img.pet-egg { width: 160px; height: 160px; max-width: 100%; object-fit: contain; }
.detail-card .track { max-width: 360px; margin-left: auto; margin-right: auto; }
.detail-note { text-align: center; }
@media (max-width: 480px) {
  #pet-detail .heading h1 { font-size: 24px; }
  .detail-card .pet-zone { height: 260px; }
}
@supports (width: 1cqw) {
  .detail-card .pet-zone img:not(.pet-egg) {
    width: calc(min(160px, 60cqw) * var(--pet-scale, 1));
    height: calc(min(160px, 60cqw) * var(--pet-scale, 1));
  }
}
@supports (width: 1cqw) {
  .pet-zone img:not(.pet-egg) {
    width: calc(min(100px, 58cqw) * var(--pet-scale, 1));
    height: calc(min(100px, 58cqw) * var(--pet-scale, 1));
  }
}
