.site-pet {
  --pet-standing-width: 105px;
  --pet-standing-height: 150px;
  --pet-rest-width: var(--pet-standing-width);
  --pet-rest-height: var(--pet-standing-height);
  top:clamp(76px,61dvh,calc(100dvh - var(--bp-bottom) - var(--pet-standing-height)));
  right:calc(var(--sar) - 8px);
  bottom:auto;
}
.bp-sprite,.bp-motion-canvas,.bp-sprite-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: none;
}
.site-pet[data-sprite-ready] .bp-figure img { display: none; }
.site-pet[data-sprite-ready] .bp-sprite { display: block; }
.site-pet[data-pet-gpu] .bp-sprite { visibility:hidden; }
.site-pet[data-pet-gpu] .bp-motion-canvas { display:block; }
.site-pet .bp-sprite-ghost:not([hidden]) { display:block; }
.site-pet[data-pet-fallback-motion] .bp-figure {
  animation:pet-fallback-breathe 3.6s ease-in-out infinite alternate;
}
@keyframes pet-fallback-breathe {
  from { translate:-1px 0; scale:1 1; }
  to { translate:1px 0; scale:1.006 1.025; }
}
.site-pet:not([data-pet-position])[data-pet-peek="right"] { right:var(--sar); }
.site-pet[data-pet-position][data-pet-peek="top"] { top:var(--sat); }
.site-pet[data-pet-peek] .bp-launch {
  position:relative;
  width:calc(var(--pet-standing-height) * .55 + 6px);
  height:max(52px,calc(var(--pet-standing-height) * .55)); overflow:hidden;
  border-radius:0;
}
.site-pet[data-pet-peek] .bp-figure {
  position:absolute; top:0; left:50%; margin-left:calc(var(--pet-standing-width) / -2);
  width:var(--pet-standing-width);height:var(--pet-standing-height);
  clip-path:inset(0 0 64%);
}
.site-pet[data-pet-peek="left"] .bp-figure { margin-left:calc(var(--pet-standing-width) / -2 - 9px); }
.site-pet[data-pet-peek="right"] .bp-figure { margin-left:calc(var(--pet-standing-width) / -2 + 4px); }
.site-pet[data-pet-peek] .bp-figure { transform-origin:50% 17%; }
.bp-grip-sprite,.bp-grip-motion {
  display:none; position:absolute; inset:0; width:100%; height:100%; pointer-events:none; object-fit:fill;
}
.site-pet[data-pet-peek][data-grip-ready] .bp-figure { visibility:hidden; }
.site-pet[data-pet-peek][data-grip-ready] .bp-grip-sprite { display:block; }
.site-pet[data-pet-peek][data-grip-gpu] .bp-grip-sprite { visibility:hidden; }
.site-pet[data-pet-peek][data-grip-gpu] .bp-grip-motion { display:block; }
.site-pet .bp-foot button[aria-pressed="true"] { color:var(--accent); }
.site-pet .bp-panel { gap:8px; font-size:12px; }
.bp-care,.bp-wardrobe { display:grid; gap:8px; min-width:0; }
.bp-mode { display:flex; gap:4px; padding:3px; border-radius:6px; background:var(--bg); }
.bp-mode button { flex:1; background:transparent; font-size:11px; white-space:nowrap; }
.bp-mode button[aria-pressed="true"] { color:var(--accent); background:var(--accent-soft); }
.bp-look-status { margin:0; font-size:11px; color:var(--ink-2); line-height:1.45; }
.bp-catalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.bp-shop-item { display:grid; gap:4px; min-width:0; padding:5px; text-align:center; border:1px solid var(--line); border-radius:6px; }
.bp-shop-item[data-wearing="true"] { border-color:var(--accent); }
.bp-shop-art { width:min(100%,72px); aspect-ratio:3/4; justify-self:center; background-repeat:no-repeat; background-size:400% 300%; }
.bp-shop-art canvas { display:none; width:100%; height:100%; }
.bp-shop-art canvas[data-ready] { display:block; }
.bp-shop-art:has(canvas[data-ready]) { background-image:none!important; }
.bp-shop-item strong { color:var(--ink); font-size:11px; }
.bp-shop-actions { display:grid; grid-template-columns:1fr 1fr; gap:3px; }
.bp-shop-actions button { min-width:0; min-height:30px; padding:2px; font-size:10px; white-space:nowrap; }
.bp-shop-actions button[data-pet="equip-look"]:not([aria-disabled="true"]) { color:var(--accent); background:var(--accent-soft); }
.bp-shop-actions button[aria-disabled="true"] { color:var(--ink-3); background:transparent; cursor:default; }
.bp-game-wallet {
  display:flex; align-items:center; justify-content:space-between; min-height:30px; padding:4px 8px;
  color:var(--accent); background:var(--accent-soft); border-radius:6px;
}
.bp-game-wallet strong { margin-left:6px; font-size:16px; font-variant-numeric:tabular-nums; }
.bp-coin-delta { font-weight:700; }
.bp-coin-delta[data-negative="true"] { color:var(--ink-2); }
.site-pet .bp-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
.site-pet .bp-actions button { display:grid; align-content:center; gap:2px; min-height:39px; padding:4px; }
.site-pet .bp-actions button small { font-size:9px; color:var(--ink-2); white-space:nowrap; }
.site-pet .bp-actions button[data-pet="rest"] { grid-column:1/-1; display:flex; align-items:center; justify-content:center; gap:8px; }
.bp-quests { display:grid; gap:2px; padding-top:6px; border-top:1px solid var(--line); }
.bp-quest-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.bp-quest-heading h3 { margin:0; color:var(--accent); font-size:12px; }
.bp-quest-heading span { color:var(--ink-2); font-size:10px; }
.bp-quest { display:grid; grid-template-columns:minmax(0,1fr) auto 50px; gap:8px; align-items:center; }
.bp-quest-progress { color:var(--ink-2); font-variant-numeric:tabular-nums; }
.bp-quest button[aria-disabled="true"] { color:var(--ink-3); background:transparent; cursor:default; }
.bp-quest button[aria-disabled="false"] { color:var(--accent); background:var(--accent-soft); }
.site-pet .bp-quest button { min-height:28px; padding:3px; font-size:11px; }
.site-pet[data-pet-effect] .bp-figure::after {
  position:absolute; content:''; width:8px; height:8px; border:1px solid currentColor; border-radius:50%;
  left:72%; top:32%; color:#ffce72; pointer-events:none; box-shadow:10px -6px 0 -2px currentColor,-8px -9px 0 -2px currentColor;
  animation:bull-pet-particle 950ms ease-out both;
}
.site-pet[data-pet-effect="bath"] .bp-figure::after { color:#9ce7ff; width:11px; height:11px; }
.site-pet[data-pet-effect="study"] .bp-figure::after { color:#ddbcff; }
@keyframes bull-pet-particle {
  from { opacity:0; transform:translateY(4px) scale(.8); }
  25% { opacity:1; }
  to { opacity:0; transform:translate(8px,-26px) scale(1.16); }
}
@media (pointer:coarse) {
  .site-pet .bp-actions button,.site-pet .bp-quest button,.site-pet .bp-shop-actions button { min-height:44px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-pet[data-pet-effect] .bp-figure::after { animation:none; }
}
@media (max-width: 720px) {
  html:not([data-layout="desktop"]) .site-pet {
    --pet-standing-width: 77px;
    --pet-standing-height: 110px;
    --pet-rest-width: var(--pet-standing-width);
    --pet-rest-height: var(--pet-standing-height);
  }
}
