/* Living Goals: the pet is a scene object, never a dashboard meter. */
.peblet-stack {
  position: absolute;
  inset: 0;
  transform-origin: 58% 72%;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}

.character-stage.has-pet .peblet-stack { transform: translateX(8%) scale(.9); }

.pet-bed,
.home-pet,
.pet-ball,
.pet-bowl {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.pet-bed[hidden],
.home-pet[hidden],
.pet-ball[hidden],
.pet-bowl[hidden],
.village-pet[hidden] { display: none !important; }

.pet-bed {
  z-index: 4;
  left: -3%;
  bottom: 3%;
  width: 42%;
  height: 28%;
  min-width: 88px;
  min-height: 58px;
  border-radius: 50%;
  filter: drop-shadow(0 11px 8px rgba(45,25,12,.32));
}

.pet-bed-cushion {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 8%;
  height: 64%;
  border: 8px solid #77502c;
  border-radius: 49% 51% 44% 46%;
  background:
    repeating-linear-gradient(14deg,rgba(255,255,255,.08) 0 4px,rgba(65,35,18,.08) 4px 7px),
    linear-gradient(#aa7740,#7c4f2d);
  box-shadow: inset 0 8px 0 rgba(255,222,155,.18),inset 0 -7px 0 rgba(54,28,13,.2),0 5px 0 #51311d;
  transform-origin: 50% 80%;
  transition: filter .2s,transform .2s;
}

.pet-bed-cushion::before {
  content: "";
  position: absolute;
  inset: 14% 8% 17%;
  border: 3px solid rgba(255,242,205,.62);
  border-radius: 50%;
  background: radial-gradient(ellipse at 48% 35%,#bedc9b 0 32%,#75915e 64%,#536e45 100%);
  box-shadow: inset 0 7px 10px rgba(255,255,255,.22),inset 0 -8px 10px rgba(40,65,35,.23);
}

.pet-bed-cushion::after {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  top: 1%;
  height: 17%;
  border: 3px solid #b17d45;
  border-bottom-color: #69421f;
  border-radius: 50%;
  background: #c99253;
}

.pet-bed strong {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -1%;
  max-width: 94%;
  padding: 4px 9px;
  border: 2px solid #6f4726;
  border-radius: 9px;
  background: linear-gradient(#e0ad61,#bd7d3e);
  box-shadow: 0 3px 0 #67401f,inset 0 1px rgba(255,245,200,.45);
  color: #4f301b;
  font-size: clamp(8px,1vw,11px);
  line-height: 1.05;
  white-space: nowrap;
  text-shadow: 0 1px rgba(255,231,174,.55);
  transform: translateX(-50%) rotate(-2deg);
}

.pet-bed:hover .pet-bed-cushion,
.pet-bed:focus-visible .pet-bed-cushion { transform: translateY(-3px) rotate(1deg); filter: brightness(1.08); }
.pet-bed:focus-visible { outline: 4px solid #fff0a8; outline-offset: 2px; }
.pet-bed[data-mode="ready"] .pet-bed-cushion,
.pet-bed[data-mode="adopt"] .pet-bed-cushion { filter: brightness(1.12) drop-shadow(0 0 12px rgba(255,224,115,.88)); animation: bedGlow 2.2s ease-in-out infinite; }
.pet-bed.is-rustling .pet-bed-cushion { animation: bedRustle .65s ease-out; }
.pet-bed.has-sleeper .pet-bed-cushion::before { filter: brightness(.75) saturate(.8); }

.home-pet {
  z-index: 6;
  left: 1%;
  bottom: 15%;
  width: 33%;
  height: 38%;
  min-width: 72px;
  min-height: 84px;
  border-radius: 46%;
  transform-origin: 50% 88%;
  animation: petIdle 3.1s ease-in-out infinite;
}

.home-pet img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 6px rgba(49,29,16,.3));
  user-select: none;
  pointer-events: none;
}

.home-pet strong {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -4px;
  padding: 4px 9px;
  border: 2px solid #7b542f;
  border-radius: 999px;
  background: rgba(255,244,211,.94);
  box-shadow: 0 3px 0 rgba(75,45,24,.5);
  color: #5d3a23;
  font-size: clamp(8px,1vw,11px);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%,4px);
  transition: opacity .16s,transform .16s;
}

.home-pet:hover strong,
.home-pet:focus-visible strong { opacity: 1; transform: translate(-50%,0); }
.home-pet:focus-visible { outline: 4px solid #fff0a8; outline-offset: -4px; }
.home-pet.is-patted { animation: petPat .7s cubic-bezier(.18,.85,.22,1.25); }
.home-pet.is-fetching { animation: petFetch 1.25s cubic-bezier(.24,.78,.24,1); }
.home-pet.is-eating { animation: petEat 1.35s cubic-bezier(.2,.8,.2,1); }

.pet-reaction {
  position: absolute;
  z-index: 3;
  left: 55%;
  top: 6%;
  color: #f26f87;
  font-size: clamp(22px,3.4vw,42px);
  opacity: 0;
  filter: drop-shadow(0 2px 0 #fff5dd);
  pointer-events: none;
}

.home-pet.show-reaction .pet-reaction { animation: petHeart .8s ease-out; }

.pet-ball {
  z-index: 7;
  left: 31%;
  bottom: 13%;
  width: clamp(44px,9%,56px);
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
}

.pet-ball span {
  position: absolute;
  inset: 7%;
  border: 3px solid #6a4730;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%,#fff5ae 0 10%,#ef8f73 11% 39%,#5aa99c 40% 67%,#eecf63 68% 100%);
  box-shadow: inset -5px -6px 6px rgba(76,40,31,.18),0 6px 5px rgba(48,28,17,.28);
}

.pet-ball:hover span,
.pet-ball:focus-visible span { filter: brightness(1.1); transform: translateY(-3px) rotate(12deg); }
.pet-ball:focus-visible { outline: 4px solid #fff0a8; outline-offset: 2px; }
.pet-ball.is-rolling span { animation: ballRoll 1.15s cubic-bezier(.2,.75,.25,1); }

.pet-bowl {
  z-index: 7;
  left: 40%;
  bottom: 5%;
  width: 18%;
  height: 15%;
  min-width: 58px;
  min-height: 48px;
  border-radius: 48%;
}
.pet-bowl-dish {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 12%;
  height: 50%;
  border: 4px solid #71452e;
  border-radius: 22% 22% 48% 48% / 28% 28% 70% 70%;
  background: linear-gradient(#7fc2b5 0 28%,#4d8d85 29% 72%,#356d68 73%);
  box-shadow: inset 0 5px 0 rgba(255,255,255,.32),0 5px 0 #4c3024,0 8px 8px rgba(45,27,17,.28);
  transition: transform .18s,filter .18s;
}
.pet-bowl-dish::before { content:"";position:absolute;left:-5%;right:-5%;top:-17%;height:36%;border:3px solid #71452e;border-radius:50%;background:#a8ddd2;box-shadow:inset 0 3px 0 rgba(255,255,255,.5); }
.pet-bowl-dish i { position:absolute;z-index:2;top:-9%;width:18%;height:27%;border-radius:50%;background:#d68a4c;opacity:0;transform:translateY(-20px); }
.pet-bowl-dish i:nth-child(1){left:18%}.pet-bowl-dish i:nth-child(2){left:43%;background:#80a74d}.pet-bowl-dish i:nth-child(3){right:17%;background:#e5bc55}
.pet-bowl strong { position:absolute;left:50%;bottom:-8%;padding:3px 7px;border:2px solid #62412c;border-radius:8px;background:#e4b45f;box-shadow:0 3px 0 #684327;color:#513521;font-size:clamp(7px,.9vw,10px);white-space:nowrap;transform:translateX(-50%) rotate(2deg); }
.pet-bowl:hover .pet-bowl-dish,.pet-bowl:focus-visible .pet-bowl-dish{transform:translateY(-3px);filter:brightness(1.09)}
.pet-bowl:focus-visible{outline:4px solid #fff0a8;outline-offset:2px}
.pet-bowl[data-mode="ready"] .pet-bowl-dish{animation:bowlReady 2.1s ease-in-out infinite;filter:drop-shadow(0 0 9px rgba(255,224,106,.88))}
.pet-bowl.is-filled .pet-bowl-dish i{animation:foodDrop .62s cubic-bezier(.18,.82,.25,1.15) forwards}
.pet-bowl.is-filled .pet-bowl-dish i:nth-child(2){animation-delay:.08s}.pet-bowl.is-filled .pet-bowl-dish i:nth-child(3){animation-delay:.16s}

.pet-status {
  position: absolute;
  z-index: 7;
  left: 9%;
  bottom: 8%;
  max-width: min(270px,48%);
  padding: 8px 11px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 15px 15px 15px 4px;
  background: rgba(58,76,48,.92);
  box-shadow: 0 5px 16px rgba(39,24,14,.25);
  color: #fff9e8;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .16s,transform .16s;
}

.pet-status.show { opacity: 1; transform: translateY(0); }

.adoption-dialog {
  width: min(760px,94vw);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(18px,3vw,30px);
  border: 5px solid #c49153;
  border-radius: 30px;
  background: linear-gradient(rgba(255,251,235,.96),rgba(255,245,218,.97)),#fff8e8;
  box-shadow: 0 25px 80px rgba(43,27,17,.5),inset 0 2px rgba(255,255,255,.8);
  color: #4f3928;
  text-align: center;
}

.adoption-dialog::backdrop { background: rgba(43,29,20,.68); backdrop-filter: blur(5px); }
.adoption-dialog[open] { animation: adoptionArrive .38s cubic-bezier(.18,.83,.25,1.18); }
.adoption-dialog h2 { margin: 4px 0 7px; font-size: clamp(27px,4vw,38px); line-height: 1.05; }
.adoption-dialog > p:not(.dialog-eyebrow):not(.adoption-note) { max-width: 590px; margin: 0 auto 17px; color: #6e5a49; line-height: 1.45; }

.pet-choices {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 12px;
  max-height: min(55dvh,520px);
  padding: 2px 5px 8px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.pet-choice {
  min-width: 0;
  padding: 8px 7px 11px;
  border: 4px solid #dfc9a4;
  border-radius: 22px;
  background: #fffaf0;
  color: #503928;
  box-shadow: 0 5px 0 #c9ad80;
  cursor: pointer;
  transition: transform .15s,border-color .15s,background .15s;
}
.pet-choice:hover,
.pet-choice:focus-visible { transform: translateY(-4px); border-color: #e88a97; }
.pet-choice[aria-pressed="true"] { border-color: #e86e86; background: #fff0f3; box-shadow: 0 5px 0 #c9586e,0 0 0 4px rgba(237,112,134,.16); }
.pet-choice img { display: block; width: 100%; height: clamp(105px,18vw,175px); object-fit: contain; filter: drop-shadow(0 7px 5px rgba(65,41,25,.18)); pointer-events: none; }
.pet-choice strong,
.pet-choice small { display: block; }
.pet-choice strong { font-size: clamp(12px,1.8vw,16px); }
.pet-choice small { margin-top: 3px; color: #7b6b5c; font-size: 10px; }
.adoption-dialog.is-pet-ready .pet-choices { grid-template-columns: minmax(180px,260px); justify-content: center; }

.pet-name-field { display: grid; gap: 7px; max-width: 390px; margin: 18px auto 0; font-weight: 1000; }
.pet-name-field input { width: 100%; min-height: 49px; padding: 9px 14px; border: 3px solid #d8b780; border-radius: 15px; background: white; color: #493424; font-size: 18px; font-weight: 1000; text-align: center; }
.pet-name-field input:disabled { background: #eee5d6; color: #83786b; }
.adoption-note { max-width: 590px; margin: 14px auto 0; padding: 9px 12px; border-radius: 13px; background: #e1f0e6; color: #496956; font-size: 11px; font-weight: 900; }
.adoption-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; max-width: 500px; margin: 16px auto 0; }
.adoption-actions button { min-height: 50px; padding: 10px 14px; border: 0; border-radius: 999px; font-weight: 1000; cursor: pointer; }
.adoption-actions button:first-child { background: #e9dfce; color: #715a48; }
.adoption-actions button:last-child { background: linear-gradient(#f8899d,#e7657d); box-shadow: 0 5px 0 #b8475e; color: white; }
.adoption-actions button:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }

.feeding-dialog {
  width: min(580px,94vw);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(19px,4vw,32px);
  border: 5px solid #72a794;
  border-radius: 30px;
  background: linear-gradient(#fffced,#f6edd3);
  box-shadow: 0 25px 80px rgba(43,27,17,.5),inset 0 2px rgba(255,255,255,.85);
  color: #4f3928;
  text-align: center;
}
.feeding-dialog::backdrop{background:rgba(43,29,20,.68);backdrop-filter:blur(5px)}
.feeding-dialog[open]{animation:adoptionArrive .34s cubic-bezier(.18,.83,.25,1.18)}
.feeding-dialog h2{margin:4px 0 7px;font-size:clamp(28px,5vw,38px)}
.feeding-dialog>p:not(.dialog-eyebrow):not(.feeding-shortfall){max-width:470px;margin:0 auto 15px;color:#6d5b4b;line-height:1.45}
.feeding-balances{display:flex;justify-content:center;gap:9px;margin:13px 0}.feeding-balances span{padding:7px 11px;border:2px solid #d7c59d;border-radius:999px;background:#fffaf0;font-size:11px;font-weight:1000}.feeding-balances strong{margin-left:4px}
.meal-choices{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.meal-choice{display:grid;place-items:center;gap:4px;min-height:170px;padding:11px;border:4px solid #dac49c;border-radius:22px;background:#fffaf0;box-shadow:0 5px 0 #c6a875;color:#4f3928;cursor:pointer;transition:transform .15s,border-color .15s}
.meal-choice:hover,.meal-choice:focus-visible{transform:translateY(-4px);border-color:#e98494}.meal-choice:disabled{opacity:.46;box-shadow:none;cursor:not-allowed;transform:none}
.meal-art{width:78px;height:68px;display:grid;place-items:center;border:4px solid #744b30;border-radius:50% 50% 44% 44%;background:linear-gradient(#a8ddd2 0 25%,#548f86 26% 100%);box-shadow:inset 0 6px rgba(255,255,255,.3),0 5px 0 #563825;font-size:34px}.meal-art.treat{background:linear-gradient(#f7cf8a 0 25%,#df7b68 26% 100%)}
.meal-choice strong{font-size:14px}.meal-choice small{color:#766758;font-size:10px}.meal-choice small b{color:#3c8064;letter-spacing:.08em}
.feeding-shortfall{margin:12px 0 0!important;padding:9px 11px;border-radius:13px;background:#ffe1dd;color:#9a4350!important;font-size:12px;font-weight:900}.cancel-feeding{min-height:45px;margin-top:14px;padding:9px 16px;border:0;border-radius:999px;background:#e7ddca;color:#6e5847;font-weight:1000;cursor:pointer}

/* The chosen companion lives beside the one Peblet in the village landscape. */
.village-pet {
  position: absolute;
  z-index: 13;
  left: var(--village-pet-x, 63.5%);
  top: auto;
  bottom: 11%;
  width: 7.5%;
  height: auto;
  aspect-ratio: 1;
  min-width: 56px;
  min-height: 70px;
  padding: 0;
  border: 0;
  border-radius: 45%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  overflow: visible;
  transform-origin: 50% 100%;
  animation: villagePetIdle 3.2s ease-in-out infinite;
}

@media (min-width: 901px) {
  .village-pet { left: var(--village-pet-x, 70%); }
}
.village-pet::before { content:"";position:absolute;z-index:0;left:19%;right:19%;bottom:-1%;height:8%;border-radius:50%;background:rgba(29,55,34,.3);filter:blur(3px);pointer-events:none; }
.village-pet img { position: absolute; z-index:1; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(31,55,37,.3)); animation:none!important; pointer-events: none; }
.village-pet strong { position: absolute; z-index:3; left: 50%; bottom: -5px; padding: 3px 7px; border-radius: 999px; background: rgba(255,248,226,.95); color: #4e3a27; font-size: 8px; white-space: nowrap; opacity: 0; transform: translateX(-50%); }
.village-pet:hover strong,
.village-pet:focus-visible strong { opacity: 1; }
.village-pet:hover,
.village-pet:focus-visible { filter: drop-shadow(0 0 11px rgba(255,239,151,.95)); outline: none; }
.village-pet:focus-visible { box-shadow: inset 0 0 0 4px #fff0a8; }
.village-pet.is-reacting { animation: villagePetReact .72s cubic-bezier(.18,.85,.22,1.2); }
.village-pet-heart { position: absolute; z-index: 2; left: 48%; top: 3%; color: #f36e86; font-size: 24px; opacity: 0; filter: drop-shadow(0 2px #fff4dc); pointer-events: none; }
.village-pet.is-reacting .village-pet-heart { animation: petHeart .72s ease-out; }

@keyframes bedGlow { 50% { filter: brightness(1.18) drop-shadow(0 0 18px rgba(255,225,117,.95)); transform: translateY(-2px); } }
@keyframes bedRustle { 20% { transform: rotate(-3deg); } 45% { transform: rotate(3deg) translateY(-3px); } 70% { transform: rotate(-1.5deg); } }
@keyframes petIdle { 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes petPat { 38% { transform: translateY(-13px) scale(1.08,.92) rotate(-3deg); } 70% { transform: translateY(-3px) scale(.96,1.04) rotate(2deg); } }
@keyframes petFetch { 0%,100% { transform: translate(0,0) rotate(0); } 45% { transform: translate(78%,10%) rotate(5deg) scale(.92); } 72% { transform: translate(36%,-4%) rotate(-3deg); } }
@keyframes petEat { 0%,100%{transform:translate(0,0) rotate(0)}35%{transform:translate(112%,18%) scale(.88) rotate(5deg)}50%,68%{transform:translate(118%,28%) scale(.86,.8) rotate(3deg)}82%{transform:translate(45%,0) rotate(-3deg)} }
@keyframes petHeart { 0% { opacity: 0; transform: translateY(8px) scale(.4); } 28% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-25px) scale(.9); } }
@keyframes ballRoll { 0%,100% { transform: translateX(0) rotate(0); } 45% { transform: translateX(180%) rotate(420deg); } 72% { transform: translateX(75%) rotate(650deg); } }
@keyframes bowlReady{50%{transform:translateY(-3px) rotate(1.5deg);filter:drop-shadow(0 0 14px rgba(255,224,106,.98))}}
@keyframes foodDrop{0%{opacity:0;transform:translateY(-28px) rotate(-15deg)}55%{opacity:1;transform:translateY(2px) rotate(8deg)}100%{opacity:0;transform:translateY(12px) scale(.75)}}
@keyframes adoptionArrive { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes villagePetIdle { 0%,100%{transform:scale(1)}50%{transform:scale(1.02,.98)} }
@keyframes villagePetReact { 0%,100%{transform:scale(1)}30%{transform:scale(1.12,.86)}58%{transform:scale(.95,1.08)}80%{transform:scale(1.04,.96)} }

@media (max-width: 820px) {
  .character-stage.has-pet .peblet-stack { transform: translateX(7%) scale(.88); }
  .pet-bed { left: 0; bottom: 4%; width: 39%; height: 26%; }
  .home-pet { left: 2%; bottom: 16%; width: 30%; height: 35%; }
  .pet-ball { left: 29%; bottom: 13%; }
  .pet-bowl { left: 39%; bottom: 5%; width: 17%; height: 14%; }
  .pet-status { left: 5%; bottom: 3%; max-width: 58%; font-size: 9px; }
  .adoption-dialog { padding: 17px 13px; border-width: 4px; }
  .pet-choices { gap: 7px; }
  .pet-choice { padding: 5px 4px 8px; border-width: 3px; border-radius: 16px; }
  .pet-choice img { height: clamp(88px,25vw,130px); }
  .pet-choice small { display: none; }
  .village-pet { min-width: 58px; min-height: 58px; }
}

@media (max-width: 560px) {
  .adoption-dialog h2 { font-size: 25px; }
  .adoption-dialog > p:not(.dialog-eyebrow):not(.adoption-note) { margin-bottom: 11px; font-size: 12px; }
  .pet-choices { grid-template-columns: repeat(2,1fr); max-height: 48dvh; }
  .pet-name-field { margin-top: 12px; }
  .adoption-actions { grid-template-columns: 1fr; }
  .feeding-dialog{padding:17px 13px;border-width:4px}.meal-choice{min-height:148px;padding:8px}
}

@media (max-width: 370px) {
  .pet-choices { grid-template-columns: 1fr; }
  .pet-choice { display: grid; grid-template-columns: 78px 1fr; align-items: center; text-align: left; }
  .pet-choice img { grid-row: span 2; height: 68px; }
  .pet-choice small { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .peblet-stack,
  .pet-bed-cushion,
  .home-pet,
  .pet-reaction,
  .pet-ball span,
  .pet-bowl-dish,
  .pet-bowl-dish i,
  .adoption-dialog[open],
  .feeding-dialog[open],
  .pet-choice,
  .village-pet,
  .village-pet-heart { animation: none !important; transition: none !important; }
  .pet-bed[data-mode="ready"] .pet-bed-cushion,
  .pet-bed[data-mode="adopt"] .pet-bed-cushion { filter: brightness(1.12) drop-shadow(0 0 12px rgba(255,224,115,.88)); }
  .home-pet.show-reaction .pet-reaction,
  .village-pet.is-reacting .village-pet-heart { opacity: 1; }
}

[data-motion="reduced"] .peblet-stack,
[data-motion="reduced"] .pet-bed-cushion,
[data-motion="reduced"] .home-pet,
[data-motion="reduced"] .pet-reaction,
[data-motion="reduced"] .pet-ball span,
[data-motion="reduced"] .pet-bowl-dish,
[data-motion="reduced"] .pet-bowl-dish i,
[data-motion="reduced"] .adoption-dialog[open],
[data-motion="reduced"] .feeding-dialog[open],
[data-motion="reduced"] .pet-choice,
[data-motion="reduced"] .village-pet,
[data-motion="reduced"] .village-pet-heart { animation: none !important; transition: none !important; }
[data-motion="reduced"] .pet-bed[data-mode="ready"] .pet-bed-cushion,
[data-motion="reduced"] .pet-bed[data-mode="adopt"] .pet-bed-cushion { filter: brightness(1.12) drop-shadow(0 0 12px rgba(255,224,115,.88)); }
[data-motion="reduced"] .home-pet.show-reaction .pet-reaction,
[data-motion="reduced"] .village-pet.is-reacting .village-pet-heart { opacity: 1; }
.pet-life-link{position:absolute;z-index:9;right:8%;bottom:13%;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:6px;min-height:44px;border:3px solid #fff2bd;border-radius:999px;background:rgba(65,112,78,.94);box-shadow:0 5px 0 rgba(42,73,50,.55);color:white;padding:7px 12px;font-size:12px;font-weight:950;text-decoration:none}.pet-life-link span{font-size:21px}.pet-life-link:hover,.pet-life-link:focus-visible{outline:4px solid #f2d268;outline-offset:3px;transform:translateY(-3px)}@media(max-width:650px){.pet-life-link{right:3%;bottom:17%}.pet-life-link strong{display:none}}

/* Pet House: every pet action and pet message lives behind this one scene
   object, leaving the dressing room calm until a child asks for pet play. */
.pet-house-hub {
  position: absolute;
  z-index: 12;
  left: -2%;
  bottom: 1%;
  width: 42%;
  height: 31%;
  min-width: 118px;
  min-height: 92px;
}

.pet-house-hub [hidden] { display: none !important; }

.pet-house-hub .pet-bed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 18px;
  filter: drop-shadow(0 10px 7px rgba(45,25,12,.34));
}

.pet-house-hub .pet-bed-cushion {
  position: absolute;
  z-index: 1;
  left: 9%;
  right: 9%;
  bottom: 3%;
  height: 63%;
  border: 5px solid #67401f;
  border-radius: 15px 15px 24px 24px;
  background:
    repeating-linear-gradient(90deg,transparent 0 22%,rgba(83,47,23,.12) 22% 24%),
    repeating-linear-gradient(0deg,#b9783d 0 17px,#c98c4d 18px 33px);
  box-shadow: inset 0 5px rgba(255,226,164,.26),0 5px 0 #4c2c18;
  overflow: visible;
}

.pet-house-hub .pet-bed-cushion::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -16%;
  right: -16%;
  top: -55%;
  height: 72%;
  border: 5px solid #5d361d;
  border-radius: 15px 15px 5px 5px;
  background: repeating-linear-gradient(90deg,#8f542b 0 18px,#a96532 19px 37px);
  box-shadow: inset 0 5px rgba(255,217,148,.22),0 5px 0 rgba(65,35,18,.5);
  clip-path: polygon(50% 0,100% 85%,94% 100%,6% 100%,0 85%);
}

.pet-house-hub .pet-bed-cushion::after {
  content: "";
  position: absolute;
  left: 29%;
  right: 29%;
  top: 24%;
  height: 72%;
  border: 4px solid #52311e;
  border-bottom: 0;
  border-radius: 45% 45% 8px 8px / 30% 30% 8px 8px;
  background: radial-gradient(ellipse at 52% 23%,#65442f,#2d211c 72%);
  box-shadow: inset 0 7px 11px rgba(0,0,0,.3);
}

.pet-house-hub .pet-bed strong {
  left: 50%;
  top: 10%;
  bottom: auto;
  z-index: 3;
  padding: 5px 10px;
  font-size: clamp(9px,1.25vw,13px);
  transform: translateX(-50%) rotate(-1deg);
}

.pet-house-hub .pet-bed small {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 7%;
  max-width: 70%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,242,204,.94);
  color: #5a3923;
  font-size: clamp(8px,1vw,11px);
  font-weight: 1000;
  line-height: 1.1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.pet-house-hub .pet-bed:hover .pet-bed-cushion,
.pet-house-hub .pet-bed:focus-visible .pet-bed-cushion { transform: translateY(-3px); }

.pet-house-hub .pet-house-menu {
  position: absolute;
  z-index: 20;
  left: 30%;
  bottom: 86%;
  width: min(350px,78vw);
  padding: 12px;
  border: 4px solid #704525;
  border-radius: 22px 22px 22px 6px;
  background: linear-gradient(155deg,rgba(255,250,224,.98),rgba(237,217,172,.98));
  box-shadow: 0 13px 28px rgba(47,28,16,.4),inset 0 2px rgba(255,255,255,.7);
  color: #533722;
}

.pet-house-hub .pet-house-menu::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -17px;
  width: 24px;
  height: 24px;
  border-right: 4px solid #704525;
  border-bottom: 4px solid #704525;
  background: #edd9ac;
  transform: rotate(45deg);
}

.pet-house-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4,minmax(54px,1fr));
  gap: 7px;
}

.pet-house-actions > button {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  align-content: start;
  gap: 3px;
  width: auto;
  height: 72px;
  min-width: 54px;
  min-height: 72px;
  padding: 8px 4px 5px;
  border: 3px solid #c69a60;
  border-radius: 16px;
  background: #fff9e8;
  box-shadow: 0 4px 0 #9b6a3c;
  color: #533722;
  cursor: pointer;
  filter: none;
  transform: none;
}

.pet-house-actions > button:hover,
.pet-house-actions > button:focus-visible {
  outline: 3px solid #f2cb64;
  outline-offset: 2px;
  transform: translateY(-2px);
}

.pet-house-actions > button > span:first-child:not(.pet-bowl-dish) {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #e76e83;
  font-size: 24px;
}

.pet-house-actions > button > strong,
.pet-house-actions .pet-bowl strong {
  position: static;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #533722;
  font-size: 11px;
  line-height: 1;
  transform: none;
}

.pet-house-actions .pet-ball span {
  position: relative;
  inset: auto;
  width: 34px;
  height: 34px;
}

.pet-house-actions .pet-bowl-dish {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 43px;
  height: 31px;
  transform: none;
}

.pet-house-actions .pet-bowl:hover .pet-bowl-dish,
.pet-house-actions .pet-bowl:focus-visible .pet-bowl-dish { transform: translateY(-2px); }

.pet-house-menu .pet-life-link,
.pet-house-menu .pet-goal-link {
  position: relative;
  z-index: 2;
  inset: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 9px;
  padding: 7px 11px;
  border: 3px solid #fff2bd;
  border-radius: 14px;
  background: #4c8060;
  box-shadow: 0 4px 0 #315a40;
  color: white;
  font-size: 12px;
  font-weight: 1000;
  text-decoration: none;
}

.pet-house-menu .pet-goal-link { background: #d87984; box-shadow: 0 4px 0 #a64e5a; }
.pet-house-menu .pet-life-link span,
.pet-house-menu .pet-goal-link span { font-size: 22px; }
.pet-house-menu .pet-life-link strong,
.pet-house-menu .pet-goal-link strong { display: block !important; }
.pet-house-menu .pet-life-link:hover,
.pet-house-menu .pet-life-link:focus-visible,
.pet-house-menu .pet-goal-link:hover,
.pet-house-menu .pet-goal-link:focus-visible { outline: 3px solid #f2cb64; outline-offset: 2px; transform: translateY(-2px); }

.pet-house-menu .pet-bond {
  position: relative;
  z-index: 2;
  inset: auto;
  width: 100%;
  max-width: none;
  margin-top: 9px;
  padding: 8px 10px;
}

.pet-house-menu .pet-status {
  position: relative;
  z-index: 2;
  inset: auto;
  max-width: none;
  min-height: 0;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  text-align: center;
}

.pet-house-menu .pet-status:empty { display: none; }
.pet-house-menu .pet-status.show { display: block; }

.pet-friends-trigger{position:relative;z-index:2;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;width:100%;min-height:46px;margin:0 0 9px;padding:7px 11px;border:3px solid #fff2bd;border-radius:14px;background:#5f83a0;box-shadow:0 4px 0 #3b5d78;color:#fff;text-align:left;font-size:12px;font-weight:1000;cursor:pointer}.pet-friends-trigger span{font-size:22px}.pet-friends-trigger:hover,.pet-friends-trigger:focus-visible{outline:3px solid #f2cb64;outline-offset:2px;transform:translateY(-2px)}.pet-friends-trigger[hidden]{display:none}
.pet-friends-dialog{width:min(760px,94vw);max-height:calc(100dvh - 24px);overflow:auto;padding:clamp(20px,3vw,30px);border:5px solid #8d6aab;border-radius:30px;background:linear-gradient(rgba(255,251,239,.98),rgba(239,231,250,.98));box-shadow:0 25px 80px rgba(43,27,58,.5);color:#4f3928}.pet-friends-dialog::backdrop{background:rgba(38,27,46,.64);backdrop-filter:blur(5px)}.pet-friends-dialog h2{margin:2px 0 7px;font-size:clamp(28px,5vw,42px)}.pet-friends-dialog>p{line-height:1.45}.pet-friend-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.pet-friend-choice{position:relative;display:grid;grid-template-rows:125px auto;gap:7px;min-height:182px;padding:11px;border:4px solid #d8c9df;border-radius:22px;background:#fff;color:#4e3a52;cursor:pointer;touch-action:manipulation}.pet-friend-choice img{width:100%;height:125px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 7px 5px rgba(60,43,69,.2));pointer-events:none}.pet-friend-choice span{display:grid;gap:2px}.pet-friend-choice strong{font-size:15px}.pet-friend-choice small{color:#75627c;font-size:12px;font-weight:900}.pet-friend-choice[aria-pressed="true"]{border-color:#6e9f7f;background:#edfaef;box-shadow:0 5px 0 #a7ceb1}.pet-friend-choice[aria-pressed="true"]::after{content:"✓";position:absolute;right:9px;top:9px;width:31px;height:31px;display:grid;place-items:center;border-radius:50%;background:#4d9569;color:#fff;font-size:19px;font-weight:1000}.pet-friend-choice:hover,.pet-friend-choice:focus-visible{outline:4px solid #f1ca67;outline-offset:2px;transform:translateY(-3px)}.pet-friends-status{min-height:24px;margin:0!important;color:#6b5473;font-size:14px;font-weight:1000;text-align:center}
@media(max-width:680px){.pet-friend-choices{grid-template-columns:1fr 1fr}.pet-friend-choice{grid-template-rows:94px auto;min-height:150px}.pet-friend-choice img{height:94px}}
@media(max-width:420px){.pet-friend-choice{grid-template-columns:82px 1fr;grid-template-rows:auto;min-height:98px;text-align:left}.pet-friend-choice img{width:82px;height:78px}.pet-friend-choice span{align-self:center}}

@media (max-width: 820px) {
  .pet-house-hub { left: 0; bottom: 0; width: 40%; height: 30%; }
  .pet-house-hub .pet-house-menu { left: 8%; bottom: 91%; width: min(330px,84vw); }
  .home-pet { left: 15%; bottom: 16%; width: 30%; height: 35%; }
}

@media (max-width: 470px) {
  .pet-house-hub { width: 43%; height: 29%; }
  .pet-house-hub .pet-house-menu { left: -2%; width: min(315px,86vw); padding: 9px; }
  .pet-house-actions { gap: 5px; }
  .pet-house-actions > button { min-width: 49px; min-height: 66px; height: 66px; padding: 6px 2px 4px; }
}
