/* The companion is a quiet website detail; no frame loop or image downloads. */
.pet-play { border-top: 1px solid var(--line, #58704c); border-bottom: 1px solid var(--line, #58704c); padding: 14px 0 12px; margin: 13px 0 20px; }
.pet-play-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.pet-play-actions button { background: #193123; border: 1px solid #617853; padding: 9px 12px; min-height: 44px; font-size: 11px; }
.pet-play-actions button:hover { background: #36513a; }
.pet-play-actions button[aria-pressed='true'] { border-color: #cfdfa9; background: #3b5236; }
.pet-preview[role='button'] { cursor: pointer; }
#petPlayMessage { min-height: 36px; font-size: 11px; color: #c9d3bc; line-height: 1.6; margin: 12px 4px 0; }
.pet-cosmetics { display: grid; grid-template-columns: 1fr; gap: 8px; border-top: 1px solid var(--line, #58704c); margin-top: 23px; padding-top: 8px; }
.pet-cosmetics label { margin: 12px 0 0 !important; }
.pet-cosmetics label span { color: #bfceae; font-size: 10px; font-weight: 400; margin-left: 7px; }
.pet-cosmetics select { width: 100%; border-radius: 10px; }
#petAppearanceMessage { min-height: 35px; margin-top: 4px; }
[data-pet-habitat] { position: relative; isolation: isolate; border-radius: 18px; }
[data-pet-habitat]::before, [data-pet-habitat]::after { content: ''; position: absolute; z-index: -1; pointer-events: none; }
[data-pet-habitat='garden'] { background: radial-gradient(ellipse at 50% 78%, #7c9b5470, #2e57391f 58%, transparent 70%); }
[data-pet-habitat='garden']::before { width: 17%; height: 32%; left: 7%; bottom: 20%; border-radius: 100% 0 100% 0; background: #789353; transform: rotate(-28deg); box-shadow: 10px 8px 0 -3px #a0ae6b; opacity: .65; }
[data-pet-habitat='garden']::after { width: 15%; height: 25%; right: 5%; bottom: 19%; border-radius: 0 100% 0 100%; background: #668b56; transform: rotate(18deg); opacity: .7; }
[data-pet-habitat='nook'] { background: radial-gradient(ellipse at 65% 35%, #dfbc6750, #7b684521 53%, transparent 72%); }
[data-pet-habitat='nook']::before { left: 12%; bottom: 12%; width: 24%; height: 4%; border-radius: 3px; background: #b29b6b; box-shadow: 2px -5px #73816b, -1px -10px #b49b82; opacity: .8; }
[data-pet-habitat='nook']::after { right: 10%; top: 18%; width: 17%; height: 20%; border-radius: 45% 45% 0 0; background: #dfc68a; opacity: .5; box-shadow: 0 8px 18px #e2c67d60; }
.pet-character { transform-origin: 60px 68px; }
.pet-treat, .pet-sleep-symbol, .pet-affection { opacity: 0; pointer-events: none; }
[data-pet-state='idle'] .pet-character { animation: pet-idle-look 8s ease-in-out infinite; }
[data-pet-state='happy'] .pet-character { animation: pet-happy-hop .6s ease-in-out 3; }
[data-pet-state='happy'] .pet-affection { opacity: .95; animation: pet-heart-drift 1.2s ease-out 2; }
[data-pet-state='eating'] .pet-character { animation: pet-nibble .7s ease-in-out infinite; }
[data-pet-state='eating'] .pet-treat { opacity: 1; }
[data-pet-state='sleeping'] .pet-eyes { animation: none; transform: scaleY(.15); }
[data-pet-state='sleeping'] .pet-tail { animation: none; }
[data-pet-state='sleeping'] .pet-body { animation: pet-sleep-breathe 6s ease-in-out infinite; }
[data-pet-state='sleeping'] .pet-sleep-symbol { opacity: .8; animation: pet-sleep-drift 4s ease-in-out infinite; }
[data-pet-paused='true'] *, [data-pet-paused='true']::before, [data-pet-paused='true']::after { animation-play-state: paused !important; }
@keyframes pet-happy-hop { 50% { transform: translateY(-3px) rotate(-1deg); } }
@keyframes pet-heart-drift { 0% { opacity: 0; transform: translateY(3px); } 25% { opacity: .95; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes pet-nibble { 50% { transform: translateY(1px) rotate(1deg); } }
@keyframes pet-sleep-breathe { 50% { transform: translateY(1px) scaleY(.985); } }
@keyframes pet-sleep-drift { 50% { transform: translateY(-2px); opacity: .45; } }
@keyframes pet-idle-look {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-2px) rotate(-1.5deg); }
  55% { transform: translateY(-.5px) rotate(1deg); }
}
@media (max-width: 390px) { .pet-play-actions { gap: 6px; } .pet-play-actions button { flex: 1 1 40%; } }
@media (prefers-reduced-motion: reduce) {
  [data-pet-state] *, [data-pet-state]::before, [data-pet-state]::after { animation: none !important; transition: none !important; }
  [data-pet-state='happy'] .pet-affection { opacity: .9; }
}
[data-pet-reduced-motion='true'] *, [data-pet-reduced-motion='true']::before, [data-pet-reduced-motion='true']::after { animation: none !important; transition: none !important; }

/* The caption/button never moves; this optional decorative copy cannot block controls. */
.pet-roaming-option { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin: 14px 0 6px; font-size: 11px; }
.pet-roaming-option input[type='checkbox'] { display: inline-block; width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; accent-color: var(--mint, #d1e0b3); }
#petRoamingHelp { margin: 6px 4px 0; text-align: center; }
.pet-roamer { position: fixed; z-index: 49; pointer-events: none; user-select: none; contain: layout style; }
.pet-landing { position: fixed; z-index: 48; height: 15px; margin-bottom: 6px; pointer-events: none; }
.pet-landing::before, .pet-landing::after { content: ''; position: absolute; pointer-events: none; }
.pet-landing::before {
  inset: 1px 9% 0; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #698d7e80, #27453e85 62%, transparent 72%);
  box-shadow: inset 0 2px 2px #a0c1a736;
}
.pet-landing::after { inset: 4px 25% 3px; border: 1px solid #c0d8b34f; border-radius: 50%; }
.pet-roamer[hidden], .pet-landing[hidden] { display: none; }
.pet-roamer .companion-art { width: 100%; height: 100%; }
.companion-widget[data-pet-away='true'] > .companion-art { visibility: hidden; }
.pet-roamer[data-roam-phase='walking-left'] { animation: pet-walk-left var(--pet-roam-time, 32000ms) linear both; will-change: transform; }
.pet-roamer[data-roam-phase='walking-home'] { animation: pet-walk-home var(--pet-roam-time, 32000ms) linear both; will-change: transform; }
.pet-roamer[data-roam-phase='napping'] { transform: translateX(0); }
.pet-roamer[data-roam-phase='walking-left'] .companion-art > svg { transform: scaleX(-1); }
.pet-roamer[data-roam-phase^='walking-'] .pet-character { animation: pet-walk-step .85s ease-in-out infinite; }
.pet-roamer[data-pet-paused='true'] { animation-play-state: paused !important; }
.modal-open .pet-roamer, .modal-open .pet-landing { visibility: hidden; }
@keyframes pet-walk-left { from { transform: translateX(var(--pet-roam-distance, 0px)); } to { transform: translateX(0); } }
@keyframes pet-walk-home { from { transform: translateX(0); } to { transform: translateX(var(--pet-roam-distance, 0px)); } }
@keyframes pet-walk-step { 25% { transform: translateY(-2.4px) rotate(-1.5deg); } 75% { transform: translateY(-1.6px) rotate(1.5deg); } }
@media (max-width: 700px) {
  .companion-widget {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + var(--pet-dock-lift, 0px));
    min-width: 0;
    width: 64px;
    height: 56px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 17px;
  }
  .companion-widget > .companion-art { width: 60px; height: 52px; }
  .companion-widget > .companion-caption { display: none; }
  .companion-widget[data-pet-away='true']::after { content: 'Pet'; position: absolute; inset: 0; display: grid; place-items: center; }
  .companion-widget > .companion-spark { font-size: 15px; top: -8px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pet-roamer, .pet-landing { display: none !important; animation: none !important; }
  .companion-widget[data-pet-away='true'] > .companion-art { visibility: visible; }
  .companion-widget[data-pet-away='true']::after { display: none; }
}
