/* v851 — one miniature Familiar coordinate system.
   The pet model and selected Extra are centered and scaled as a single unit
   in the header shortcut, AI tip button, assistant header, and chat portrait. */
:is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675){
  position:relative!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  isolation:isolate!important;
}

html body .gg-ai-pet-v370>.gg-familiar-avatar-v339,
html body .gg-ai-msg-v370 i>.gg-familiar-avatar-v339,
html body .gg-ai-helper-v370>.gg-familiar-avatar-v339,
html body .gg-familiar-trigger-v339.gg-active-familiar-trigger-v670 .gg-active-familiar-icon-v670>.gg-familiar-avatar-v339,
html body .gg-active-familiar-icon-v675>.gg-familiar-avatar-v339{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:128px!important;
  height:128px!important;
  margin:0!important;
  padding:0!important;
  transform-origin:50% 50%!important;
  pointer-events:none!important;
}
html body .gg-ai-pet-v370>.gg-familiar-avatar-v339{
  transform:translate(-50%,-50%) scale(.43)!important;
}
html body .gg-ai-msg-v370 i>.gg-familiar-avatar-v339{
  transform:translate(-50%,-50%) scale(.33)!important;
}
html body .gg-ai-helper-v370>.gg-familiar-avatar-v339{
  transform:translate(-50%,-50%) scale(.31)!important;
}
html body .gg-familiar-trigger-v339.gg-active-familiar-trigger-v670 .gg-active-familiar-icon-v670>.gg-familiar-avatar-v339,
html body .gg-active-familiar-icon-v675>.gg-familiar-avatar-v339{
  transform:translate(-50%,-50%) scale(.33)!important;
}

/* Keep the model and accessory inside the same 128px canvas. */
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .gg-familiar-avatar-v339>.pet-hover{
  position:relative!important;
  width:100%!important;
  height:100%!important;
  overflow:visible!important;
}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .pet-model-v345{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
}

/* Refined head and neck anchors. These values are shared by the full pet and
   every miniature preview, so an Extra cannot drift when a frame gets smaller. */
[data-pet-type]{
  --gg-extra-bow-left:54%;--gg-extra-bow-top:9%;--gg-extra-bow-width:21%;--gg-extra-bow-height:18%;
  --gg-extra-band-left:30%;--gg-extra-band-top:56%;--gg-extra-band-width:40%;--gg-extra-band-height:17%;
  --gg-extra-glasses-left:25%;--gg-extra-glasses-top:29%;--gg-extra-glasses-width:50%;--gg-extra-glasses-height:19%;
  --gg-extra-halo-left:27%;--gg-extra-halo-top:-1%;--gg-extra-halo-width:46%;--gg-extra-halo-height:15%;
  --gg-extra-star-left:66%;--gg-extra-star-top:12%;--gg-extra-star-size:17cqw;
  --gg-extra-antler-top:-5%;--gg-extra-antler-width:70%;--gg-extra-antler-height:32%;
}
:is([data-pet-type="dove"],[data-pet-type="crow"],[data-pet-type="alienChicken"]){
  --gg-extra-bow-left:53%;--gg-extra-bow-top:8%;--gg-extra-bow-width:20%;--gg-extra-bow-height:17%;
  --gg-extra-band-left:32%;--gg-extra-band-top:58%;--gg-extra-band-width:36%;
  --gg-extra-glasses-left:28%;--gg-extra-glasses-top:27%;--gg-extra-glasses-width:44%;--gg-extra-glasses-height:18%;
  --gg-extra-halo-left:29%;--gg-extra-halo-top:0%;--gg-extra-halo-width:42%;
  --gg-extra-star-left:65%;--gg-extra-star-top:12%;
}
:is([data-pet-type="robotOwl"],[data-pet-type="moonOwl"]){
  --gg-extra-bow-left:57%;--gg-extra-bow-top:12%;--gg-extra-bow-width:22%;
  --gg-extra-band-left:31%;--gg-extra-band-top:58%;--gg-extra-band-width:38%;
  --gg-extra-glasses-left:26%;--gg-extra-glasses-top:29%;--gg-extra-glasses-width:48%;
  --gg-extra-halo-left:27%;--gg-extra-halo-top:0%;--gg-extra-halo-width:46%;
  --gg-extra-star-left:66%;--gg-extra-star-top:13%;
}
:is([data-pet-type="dog"],[data-pet-type="cat"],[data-pet-type="bunny"]){
  --gg-extra-bow-left:57%;--gg-extra-bow-top:10%;--gg-extra-bow-width:22%;
  --gg-extra-band-left:31%;--gg-extra-band-top:59%;--gg-extra-band-width:38%;
  --gg-extra-glasses-left:25%;--gg-extra-glasses-top:29%;--gg-extra-glasses-width:50%;
  --gg-extra-halo-left:27%;--gg-extra-halo-top:-3%;--gg-extra-halo-width:46%;
  --gg-extra-star-left:67%;--gg-extra-star-top:11%;--gg-extra-antler-top:-7%;
}
:is([data-pet-type="ghost"],[data-pet-type="mirrorGhost"],[data-pet-type="stormJelly"]){
  --gg-extra-bow-left:57%;--gg-extra-bow-top:10%;--gg-extra-bow-width:22%;
  --gg-extra-band-left:31%;--gg-extra-band-top:57%;--gg-extra-band-width:38%;
  --gg-extra-glasses-left:26%;--gg-extra-glasses-top:29%;--gg-extra-glasses-width:48%;
  --gg-extra-halo-left:27%;--gg-extra-halo-top:-3%;--gg-extra-halo-width:46%;
  --gg-extra-star-left:66%;--gg-extra-star-top:12%;
}
:is([data-pet-type="bat"],[data-pet-type="cuckooBat"],[data-pet-type="deathMoth"],[data-pet-type="miniDragon"]){
  --gg-extra-bow-left:58%;--gg-extra-bow-top:16%;--gg-extra-bow-width:22%;
  --gg-extra-band-left:32%;--gg-extra-band-top:60%;--gg-extra-band-width:36%;
  --gg-extra-glasses-left:28%;--gg-extra-glasses-top:33%;--gg-extra-glasses-width:44%;
  --gg-extra-halo-left:29%;--gg-extra-halo-top:2%;--gg-extra-halo-width:42%;
  --gg-extra-star-left:67%;--gg-extra-star-top:17%;
}
:is([data-pet-type="flameBall"],[data-pet-type="waterBall"],[data-pet-type="astroFish"],[data-pet-type="waterStar"]){
  --gg-extra-bow-left:57%;--gg-extra-bow-top:14%;--gg-extra-bow-width:22%;
  --gg-extra-band-left:31%;--gg-extra-band-top:59%;--gg-extra-band-width:38%;
  --gg-extra-glasses-left:27%;--gg-extra-glasses-top:32%;--gg-extra-glasses-width:46%;
  --gg-extra-halo-left:28%;--gg-extra-halo-top:0%;--gg-extra-halo-width:44%;
  --gg-extra-star-left:66%;--gg-extra-star-top:15%;
}

/* Undo older miniature-only accessory transforms. */
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  :is(.pet-accessory.bow,.pet-accessory.bandana,.pet-accessory.glasses,.pet-accessory.star-clip){
  transform:none!important;
}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .pet-accessory.halo{
  transform:rotate(-4deg)!important;
}

@media(max-width:680px){
  html body .gg-ai-helper-v370>.gg-familiar-avatar-v339{
    transform:translate(-50%,-50%) scale(.29)!important;
  }
}

/* Apply the same percentage anchors outside Pet Salon as well. */
html body [data-pet-type]>.pet-hover{container-type:inline-size}
html body [data-pet-type]>.pet-hover>.pet-accessory{position:absolute!important;right:auto!important;bottom:auto!important;box-sizing:border-box!important;transform-origin:center!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.bow{left:var(--gg-extra-bow-left)!important;top:var(--gg-extra-bow-top)!important;width:var(--gg-extra-bow-width)!important;height:var(--gg-extra-bow-height)!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.bandana{left:var(--gg-extra-band-left)!important;top:var(--gg-extra-band-top)!important;width:var(--gg-extra-band-width)!important;height:var(--gg-extra-band-height)!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.glasses{left:var(--gg-extra-glasses-left)!important;top:var(--gg-extra-glasses-top)!important;width:var(--gg-extra-glasses-width)!important;height:var(--gg-extra-glasses-height)!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.halo{left:var(--gg-extra-halo-left)!important;top:var(--gg-extra-halo-top)!important;width:var(--gg-extra-halo-width)!important;height:var(--gg-extra-halo-height)!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.star-clip{left:var(--gg-extra-star-left)!important;top:var(--gg-extra-star-top)!important;font-size:var(--gg-extra-star-size)!important}
html body [data-pet-type]>.pet-hover>.pet-accessory.antlers{left:50%!important;top:var(--gg-extra-antler-top)!important;width:var(--gg-extra-antler-width)!important;height:var(--gg-extra-antler-height)!important;transform:translateX(-50%)!important}

body.avatar-page #ggV580CornerTools .gg-active-familiar-icon-v675>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.40)!important}

/* v851 — thumbnails use the same square model canvas as the full Familiar.
   No later miniature rule may independently move the model or its Extra. */
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .gg-familiar-avatar-v339>.pet-hover{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:128px!important;
  height:128px!important;
  margin:0!important;
  transform:none!important;
  translate:none!important;
  scale:1!important;
  animation:none!important;
}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .gg-familiar-avatar-v339>.pet-hover>:is(svg,img,[class*="sprite"],[class*="glow"]){
  max-width:none!important;
  max-height:none!important;
}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .gg-familiar-avatar-v339>.pet-hover>:is(svg,img){
  display:block!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .pet-accessory,
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  .pet-accessory *{
  animation:none!important;
  transition:none!important;
}
html body .gg-ai-pet-v370>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.48)!important}
html body .gg-ai-msg-v370 i>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.38)!important}
html body .gg-ai-helper-v370>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.35)!important}
html body .gg-familiar-trigger-v339.gg-active-familiar-trigger-v670 .gg-active-familiar-icon-v670>.gg-familiar-avatar-v339,
html body .gg-active-familiar-icon-v675>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.52)!important}
body.avatar-page #ggV580CornerTools .gg-active-familiar-icon-v675>.gg-familiar-avatar-v339{transform:translate(-50%,-50%) scale(.60)!important}
html body :is(.gg-ai-pet-v370,.gg-ai-msg-v370 i,.gg-ai-helper-v370,.gg-active-familiar-icon-v670,.gg-active-familiar-icon-v675)
  :is([data-pet-type="dove"],[data-pet-type="crow"]){--gg-extra-bow-left:51%;--gg-extra-bow-top:13%}

/* v1027 familiar remodel sprites — original Grim & Goldie crow/dove/bat turnarounds. */
.gg-familiar-sprite-v1027{overflow:visible!important;background:none!important}
.gg-familiar-sprite-v1027>.pet-hover{position:relative!important;width:100%!important;height:100%!important;overflow:visible!important}
.gg-v1027-pet-sprite-stack{position:absolute;inset:-10%;display:block;pointer-events:none;z-index:1}
.gg-v1027-pet-pose{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center;display:none!important;filter:drop-shadow(0 4px 3px rgba(18,17,26,.22));transform-origin:50% 78%}
.gg-v1027-pet-front{display:block!important}
.gg-familiar-sprite-v1027 .pet-accessory,.gg-familiar-sprite-v1027 .gg-pet-session-transform-v388{z-index:5!important}
.gg-island-familiar-v682[data-direction="left"] .gg-familiar-sprite-v1027 .gg-v1027-pet-front,
.gg-island-familiar-v682[data-direction="right"] .gg-familiar-sprite-v1027 .gg-v1027-pet-front,
.gg-island-familiar-v682[data-direction="back"] .gg-familiar-sprite-v1027 .gg-v1027-pet-front{display:none!important}
.gg-island-familiar-v682[data-direction="left"] .gg-familiar-sprite-v1027 .gg-v1027-pet-side,
.gg-island-familiar-v682[data-direction="right"] .gg-familiar-sprite-v1027 .gg-v1027-pet-side{display:block!important}
.gg-island-familiar-v682[data-direction="right"] .gg-familiar-sprite-v1027 .gg-v1027-pet-side{transform:scaleX(-1)}
.gg-island-familiar-v682[data-direction="back"] .gg-familiar-sprite-v1027 .gg-v1027-pet-back{display:block!important}
.gg-island-familiar-v682:is(.ggi-familiar-flying-v682,.is-flying,.petted) .gg-familiar-sprite-v1027 .gg-v1027-pet-front{display:none!important}
.gg-island-familiar-v682:is(.ggi-familiar-flying-v682,.is-flying,.petted) .gg-familiar-sprite-v1027 .gg-v1027-pet-fly{display:block!important;animation:ggV1027PetFlight .66s ease-in-out infinite alternate}
@keyframes ggV1027PetFlight{from{translate:0 2px;rotate:-1.5deg}to{translate:0 -4px;rotate:1.5deg}}
@media(prefers-reduced-motion:reduce){.gg-v1027-pet-fly{animation:none!important}}
