/* Keep every part of the portrait inside one native button hit target. */
.habitat .pet-area{z-index:2;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;border-radius:38%}
.habitat .pet-area *,.habitat .pet-speech,.habitat .pet-tag,.habitat .pet-floor-label{pointer-events:none}
.habitat .pet-speech{z-index:4}
.habitat .habitat-weather{z-index:5}
.pet-area:focus-visible{outline:3px solid #ac8055;outline-offset:2px;background:#ffffff18}
.pet-touch-heart{position:absolute;left:65%;top:16%;font-size:39px;font-weight:600;line-height:1;color:#bf788a;text-shadow:0 2px 8px #fff;opacity:0;transform:translateY(10px) scale(.7)}
.room-pet-reaction .pet-touch-heart{animation:room-heart-reply 1.8s ease-out both}
.room-pet-reaction .pet-area .creature{animation:room-pet-reply .68s ease-in-out 2}
.room-pet-reaction .pet-speech{box-shadow:0 0 0 2px #d9b9a855,0 5px 15px #4b633914}
.garden-care-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:11px 12px;background:#fffdf7}
.garden-care-actions button{min-width:0;min-height:70px;gap:5px;padding:8px 4px;flex-direction:column;border-radius:15px;font-size:13px;line-height:1.4;background:#f4f2e8;border-color:#e1ddcd;box-shadow:0 2px 0 #dbd6c733}
.garden-care-actions button:nth-child(1){color:#8d6470;background:#faf0ef;border-color:#ebdbd9}
.garden-care-actions button:nth-child(2){color:#496c51;background:#eaf1e5;border-color:#d1deca}
.garden-care-actions button:nth-child(3){background:#f5f1e3;border-color:#e4dcc5}
.garden-care-actions button:nth-child(4){background:#f7f0f3;border-color:#e8dce3}
.garden-care-actions button svg,.garden-care-actions button img{display:block;width:27px;height:27px;object-fit:contain;pointer-events:none}
.garden-care-actions button svg{fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}
.garden-care-actions button b{font-size:inherit;font-weight:700;white-space:nowrap}
.garden-care-actions button:hover{filter:brightness(.985)}
.living-pet{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.living-pet *{pointer-events:none}
.living-actor.living-touching,.living-actor.living-touching *,.living-actor:focus-within,.living-actor:focus-within *{animation-play-state:paused!important}
.living-selected-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
.living-selected-actions[hidden]{display:none}
.living-selected-actions button{min-height:44px;border:1px solid #d9e1ce;border-radius:13px;padding:9px 14px;background:#f5f7ec;color:#526d4c;font-size:12px;font-weight:700}
.living-selected-actions .living-visit{margin:0;flex:1;min-width:150px;background:#ebf1e3}
/* The complete shared-coordinate play stage scales as one piece. */
dialog:has(.garden-play),dialog:has(.wardrobe-preview){overflow-anchor:none}
.garden-play-stage{inset:42px 8px 8px;min-width:0;min-height:0}
.garden-play-canvas{max-width:100%;max-height:100%;overflow:hidden}
.garden-play-canvas foreignObject>div{max-width:100%;max-height:100%}
.wardrobe-preview>.dressed-pet,.detail-art>.dressed-pet{max-width:100%;max-height:100%}
.wardrobe-preview>.dressed-pet>svg,.detail-art>.dressed-pet>svg{max-width:100%;max-height:100%}
@keyframes room-heart-reply{0%{opacity:0;transform:translateY(10px) scale(.7)}20%{opacity:1;transform:translateY(0) scale(1.12)}70%{opacity:1}100%{opacity:0;transform:translateY(-34px) scale(.94)}}
@keyframes room-pet-reply{0%,100%{transform:translateY(0) scale(1)}35%{transform:translateY(2px) scale(1.035,.96)}65%{transform:translateY(-7px) scale(.99,1.02)}}
@media(max-width:730px){.garden-care-actions{gap:6px;padding:9px 7px}.garden-care-actions button{min-height:67px;font-size:12px}.habitat .pet-area{min-width:220px;min-height:220px}.pet-touch-heart{font-size:34px}.living-selected-actions{gap:6px}.living-selected-actions button{padding:9px 11px}.living-selected-actions .living-visit{flex-basis:100%}}
@media(max-width:480px){
 dialog:has(.garden-play) .dialog-shell,dialog:has(.wardrobe-preview) .dialog-shell{padding:18px 14px}
 dialog:has(.garden-play) .dialog-top,dialog:has(.wardrobe-preview) .dialog-top{margin-bottom:10px}
 .play-scene.garden-play{height:clamp(190px,35dvh,280px)!important;min-height:0;max-height:calc(100dvh - 220px)}
 .garden-play #play-speech{font-size:11px;line-height:1.55;padding:6px 8px}
 .garden-play-stage{inset:42px 7px 6px}
 #play-scene+.friendship-meter{margin:9px 0;padding:8px 12px;border-radius:13px}
 #play-scene+.friendship-meter .friendship-label{font-size:11px;margin:3px 0}
 #play-scene+.friendship-meter .friendship-hint{font-size:10px;line-height:1.5;margin-top:5px}
 .play-guide{font-size:10px;line-height:1.6;margin:7px 2px 2px}
 .play-start{min-height:49px;margin-top:8px}
 .wardrobe-preview .dressed-pet{width:min(230px,68vw,34dvh)!important;height:min(230px,68vw,34dvh)!important}
 .wardrobe-preview{padding:9px 8px 12px}
 .detail-art>.dressed-pet{width:min(210px,64vw,34dvh)!important;height:min(210px,64vw,34dvh)!important}
 .evolution-compare .dressed-pet,.evolution-compare > div > svg,.evolution-compare > div > .dressed-pet > svg{max-width:100%;height:auto}
}
@media(prefers-reduced-motion:reduce){.room-pet-reaction .pet-touch-heart{opacity:1;transform:none;animation:none}.room-pet-reaction .pet-area .creature{animation:none}.room-pet-reaction .pet-area{background:#fffdf225}}
