/* 宠物 p4：小狗 / 窝 / 球在家宅地板里的样式。地上家具按「占地前沿」排前后（--fz 由 app.js 写），小狗按落地点排，前后遮挡一致 */
/* 12e：并进主预览后，只有屋里真有小狗时才改家具层级（没狗 = 主预览原样：家具 2 / 选中 4 / 高亮 3 / CEO 6） */
.room-floor:has(> .pet-dog) .furn:not(.rug){z-index:var(--fz,2)}
.room-floor:has(> .pet-dog) .furn.sel{z-index:300}
.room-floor:has(> .pet-dog) .room-hl{z-index:310}
.room-floor:has(> .pet-dog) .home-actor{z-index:400}
.pet-bed{position:absolute;z-index:5;pointer-events:none;border:2.5px solid #2b2118;border-radius:50%;background:radial-gradient(ellipse at 50% 56%,#f2d8b4 0 52%,#8f5a33 55%);box-shadow:1px 2px 0 rgba(20,20,20,.35)}
.pet-ball{position:absolute;pointer-events:none;border-radius:50%;background:radial-gradient(circle at 38% 35%,#f4ff9a 0 18%,#d6e83a 22%);border:2px solid #2b2118;box-sizing:border-box}
.pet-dog{position:absolute;pointer-events:none}
.pet-dog .pet-cv{display:block}
.pet-fx{position:absolute;left:50%;top:18%;width:0;height:0;pointer-events:none}
.pet-fx i{position:absolute;left:0;top:0;font-style:normal;font-size:18px;font-weight:900;line-height:1;transform:translateX(-50%)}
.pet-fx i.q{color:#d64545;font-size:20px}
.pet-fx i.z{color:#5b6fb5;left:14px;animation:petz 2.4s linear infinite}
@keyframes petz{0%{opacity:1;transform:translate(0,10px) scale(.8)}100%{opacity:0;transform:translate(10px,-14px) scale(1.2)}}
.pet-bar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0 2px}
.pet-bar .pet-lb{flex:1 1 100%;font-size:12px;line-height:1.4;min-height:17px}
.pet-bar .pet-lb small{margin-left:8px;color:#a0522d;font-weight:800}
.pet-bar .buy{flex:1 1 0;min-width:0;padding-left:4px;padding-right:4px}
.pet-note .buy{margin-left:6px;padding:2px 8px;font-size:12px}
.pet-ico span{font-size:min(30px,8vw);line-height:1}
.pet-card{border-color:#e07a3f}
/* p4b：卡片标题里的「宠物 · 新」不被截；满屋「暂时无法入宅」按钮折两行不挤正文；等待安置提示醒目一点 */
.pet-card .name{flex-wrap:wrap;white-space:normal;overflow:visible;row-gap:2px}
.pet-card .name .tag{white-space:nowrap}
.pet-card #petNoRoom{max-width:96px;white-space:normal;line-height:1.25;padding:6px 8px}
.pet-wait{border-color:#e07a3f;background:#fff4e6;line-height:1.5}


/* Two-slot responsive management. */
.pet-manager{margin:10px 0;padding:10px;border:2px solid #c38655;border-radius:12px;background:#fff6e8;min-width:0}
#petSlots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0}
.pet-slot{min-height:84px;padding:8px;border:1px dashed #ae795a;border-radius:8px;min-width:0;overflow-wrap:anywhere}
.pet-slot small,.pet-list-row small{display:block;font-size:11px;line-height:1.5}
.pet-slot b,.pet-list-row b{font-size:12px}
.pet-slot .buy{min-height:40px;margin-top:5px;font-size:12px;width:100%}
.pet-list-row{display:flex;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid #dbbea3}
.pet-list-row>div{flex:1;min-width:0;overflow-wrap:anywhere}
.pet-list-row .buy{min-height:40px;flex-shrink:0;font-size:12px}
.pet-replace-option{display:block;min-height:44px;width:100%;margin-top:10px;white-space:normal;overflow-wrap:anywhere}
#petReplace{max-height:65vh;overflow-y:auto}
.pet-manager summary{padding:8px 0;min-height:40px}

/* Explicit display rules on small must not override the hidden state. */
.pet-manager [hidden]{display:none!important}
/* One collapsed pet entry; only the selected species exposes controls. */
.pet-entry{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:10px 12px;margin:10px 0;border:3px solid #141414;border-radius:12px;background:#fff4c2;color:#141414;text-align:left;font:inherit;cursor:pointer;box-shadow:3px 3px 0 #141414}
.pet-entry>span{font-weight:900;white-space:nowrap}.pet-entry>small{flex:1;font-size:12px}.pet-entry>b{font-size:25px}
.pet-panel header{position:sticky;top:0;z-index:2;background:#fff6e8;padding:5px 0;display:flex;justify-content:space-between;align-items:center;gap:8px}.pet-panel h3,.pet-panel h4{margin:0}.pet-panel h4{font-size:20px;margin-bottom:8px}.pet-panel header small{font-size:12px}.pet-panel .buy{min-height:44px;white-space:normal}
.pet-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:12px 0}.pet-choice{min-width:0;min-height:58px;border:2px solid #141414;border-radius:9px;background:#fffaf0;color:#141414;font:inherit;padding:7px 3px;cursor:pointer}.pet-choice span{display:block;font-size:13px;font-weight:800}.pet-choice small{display:block;font-size:11px;margin-top:3px}.pet-choice.on{background:#ffd84d;box-shadow:2px 2px 0 #141414}.pet-selected{padding:12px;border:2px solid #141414;border-radius:10px;background:#fffaf0}.pet-selected p{margin:8px 0}.pet-arrange,.pet-records{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.pet-selected .pet-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.pet-selected .pet-bar .buy{padding:7px 3px;font-size:12px}.pet-quarantine{font-size:12px;margin-top:10px}.pet-panel :focus-visible,.pet-entry:focus-visible{outline:3px solid #cf3c29;outline-offset:3px}
@media(max-width:350px){.pet-choice span{font-size:12px}.pet-entry>small{font-size:11px}.pet-panel{padding:9px}}

/* Interactions stay with the visible room, separate from pet management. */
.pet-interaction{margin:4px 0 8px;padding:5px 7px;border:2px solid #141414;border-radius:10px;background:#fff8e8}.pet-interaction:empty{display:none}.pet-targets{display:flex;align-items:center;gap:5px;margin-bottom:4px}.pet-targets small{font-size:11px}.pet-target{min-height:44px;padding:4px 8px;border:2px solid #141414;border-radius:8px;background:#fffaf0;font:inherit;font-size:12px;font-weight:800;cursor:pointer}.pet-target.on{background:#ffd84d}.pet-interaction .pet-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0}.pet-interaction .buy{min-height:44px;padding:6px 2px;font-size:12px;white-space:normal}.pet-targeted .pet-cv{filter:drop-shadow(0 0 2px #ffc929)}.pet-interaction :focus-visible{outline:3px solid #cf3c29;outline-offset:2px}
/* Keep the room avatar from covering the pet being watched/interacted with. */
.room-floor:has(> .pet-targeted) .home-actor{z-index:6}
