/* 桌宠 626、对话气泡、粒子 */

.pet-layer { position: fixed; inset: 0; z-index: 1050; pointer-events: none; } /* 在任务栏之上、开始菜单之下 */
.pet { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.pet__body {
  position: absolute; bottom: 0; left: 0; padding: 0; border: 0; background: none;
  pointer-events: auto; cursor: grab; touch-action: none; transform-origin: 50% 70%;
}
.pet__body:active { cursor: grabbing; }
.pet__body:focus-visible { outline-offset: -4px; }
.pet__img { display: block; height: auto; width: auto; zoom: .42; margin-bottom: -12px; /* 原图统一缩放；抵消底部 12px 留白 */ filter: drop-shadow(0 3px 0 rgba(11, 18, 64, .35)); }
.pet__shadow { position: absolute; left: -32px; top: -6px; width: 64px; height: 10px; border-radius: 50%; background: #000; opacity: .35; transition: opacity .2s; }

.pet-bubble {
  --pf: var(--ink);
  position: absolute; left: 0; top: 0; width: max-content; max-width: 270px;
  padding: 8px 12px; background: var(--sand); color: var(--ink); line-height: 20px;
  pointer-events: auto; animation: bubble-in .18s var(--pop);
}
.pet-bubble::after {
  content: ''; position: absolute; left: calc(var(--tail, 50%) - 5px); bottom: -9px;
  width: 9px; height: 6px; background: var(--sand);
  box-shadow: 0 3px 0 var(--ink), 3px 3px 0 var(--sand), 6px 3px 0 var(--ink), 3px 6px 0 var(--ink), -3px 0 0 var(--ink), 9px 0 0 var(--ink);
}
.pet-bubble__chips { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.pet-bubble__chips:not(:empty) { margin: 10px 0 4px; }
.pet-bubble .chip { background: var(--stitch); color: #fff; animation: rise .2s steps(2) both; }
.pet-bubble .chip:hover { background: var(--sun); color: var(--ink); }
@keyframes bubble-in { from { opacity: 0; scale: .8; } }

.fx { position: absolute; pointer-events: none; font-size: 24px; line-height: 1; text-shadow: 2px 2px 0 var(--ink); animation: fx-up 1.1s var(--ease) both; }
.fx--note { color: var(--sun); }
.fx--heart { color: var(--hibiscus); }
.fx--star { color: var(--sun); font-size: 18px; }
.fx--z { color: var(--stitch-hi); }
.fx--crumb { width: 6px; height: 6px; background: #c48a4a; box-shadow: 2px 2px 0 #7a5230; animation-name: fx-fall; }
@keyframes fx-up { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(15deg); } }
@keyframes fx-fall { to { opacity: 0; transform: translate(var(--dx), 50px) rotate(90deg); } }

@media (max-width: 720px) {
  .pet__img { zoom: .32; }
  .has-win .pet-layer { display: none; } /* 手机上窗口是全屏的，别挡住内容 */
}

.is-shake .desk, .is-shake .scene { animation: shake .12s steps(2) 5; }
@keyframes shake { 25% { transform: translate(4px, -3px); } 75% { transform: translate(-4px, 3px); } }
