/* TradeRealm 3.4.2 — Pets collectible-card polish */

/* Keep the desktop collection dense, but make every card tall enough to show the full artwork. */
body[data-page="pets"] .tr232-collection-grid{
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr))!important;
  gap:14px!important;
  align-items:start!important;
}
body[data-page="pets"] .tr232-pet-collection-card{
  aspect-ratio:2.48/3.62!important;
  padding:8px!important;
}

/* The 3.4.1 generic child rule made the rarity chip relative. Force it back to the top-right corner. */
body[data-page="pets"] .tr232-pet-collection-card .realm-card-rarity-v142{
  position:absolute!important;
  top:9px!important;
  right:9px!important;
  left:auto!important;
  width:auto!important;
  max-width:66%!important;
  min-height:20px!important;
  margin:0!important;
  padding:4px 8px!important;
  border-radius:999px!important;
  justify-content:flex-start!important;
  font-size:6.6px!important;
  letter-spacing:.065em!important;
  z-index:10!important;
}
body[data-page="pets"] .tr232-pet-collection-card .realm-card-rarity-v142:before{
  width:6px!important;height:6px!important;flex-basis:6px!important;border-radius:1px!important;
}

/* Name sits below the rarity chip instead of competing with it. */
body[data-page="pets"] .tr232-pet-collection-card .realm-card-name-v142{
  min-height:34px!important;
  margin:27px 7px 5px!important;
  padding:0 4px!important;
  font-size:12.5px!important;
  line-height:1.07!important;
}

/* Defined art viewport = percentage max-height works reliably and the pet is never cropped. */
body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140{
  flex:0 0 auto!important;
  width:auto!important;
  height:clamp(86px,7.6vw,124px)!important;
  min-height:86px!important;
  max-height:124px!important;
  margin:0 7px 7px!important;
  padding:6px!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
  border-radius:12px!important;
}
body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140:after{
  left:24%!important;right:24%!important;bottom:6%!important;height:7%!important;opacity:.55!important;
}
body[data-page="pets"] .tr232-pet-collection-card .realm-card-img-v140,
body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140 img.realm-card-img-v140{
  display:block!important;
  position:relative!important;
  inset:auto!important;
  width:auto!important;
  height:auto!important;
  max-width:96%!important;
  max-height:96%!important;
  object-fit:contain!important;
  object-position:center center!important;
  transform:none!important;
  margin:auto!important;
}

/* Keep the value treatment from 3.4.1: it was approved. */
body[data-page="pets"] .tr340-card-value{
  margin:0 7px 6px!important;
}

/* Pokemon-style set/origin footer: label + set name on a real card footer. */
body[data-page="pets"] .tr340-card-origin{
  position:relative!important;
  z-index:6!important;
  min-height:31px!important;
  margin:0 7px 1px!important;
  padding:6px 8px!important;
  border-radius:8px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  background:
    linear-gradient(90deg,color-mix(in srgb,var(--rarity-accent) 12%,rgba(8,13,27,.84)),rgba(5,9,20,.72))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.07),0 2px 7px rgba(0,0,0,.12)!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:7px!important;
}
body[data-page="pets"] .tr340-card-origin:before{display:none!important}
body[data-page="pets"] .tr340-card-origin small{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:17px!important;
  padding:3px 6px!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--rarity-accent) 16%,rgba(4,8,18,.82))!important;
  border:1px solid color-mix(in srgb,var(--rarity-accent) 48%,rgba(255,255,255,.14))!important;
  color:color-mix(in srgb,var(--rarity-accent) 72%,#fff 28%)!important;
  font-size:5.2px!important;
  font-weight:950!important;
  letter-spacing:.105em!important;
  line-height:1!important;
}
body[data-page="pets"] .tr340-card-origin strong{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:rgba(255,255,255,.90)!important;
  font-size:6.4px!important;
  font-weight:850!important;
  letter-spacing:.015em!important;
  text-align:right!important;
}

/* Give Legendary a more card-like foil edge without making the content hard to read. */
body[data-page="pets"] .tr232-pet-collection-card.rarity-legendary{
  box-shadow:0 0 0 1px rgba(255,236,150,.46),0 14px 30px rgba(10,4,31,.32),0 0 20px rgba(255,222,111,.10)!important;
}

@media(min-width:1500px){
  body[data-page="pets"] .tr232-collection-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important}
}
@media(max-width:1180px){
  body[data-page="pets"] .tr232-collection-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140{height:clamp(82px,9vw,112px)!important}
}
@media(max-width:900px){
  body[data-page="pets"] .tr232-collection-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:760px){
  body[data-page="pets"] .tr232-collection-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  body[data-page="pets"] .tr232-pet-collection-card{aspect-ratio:2.34/3.62!important;padding:5px!important}
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-rarity-v142{
    position:absolute!important;top:6px!important;right:6px!important;left:auto!important;
    min-height:16px!important;padding:3px 5px!important;font-size:4.6px!important;max-width:70%!important
  }
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-rarity-v142:before{width:4.5px!important;height:4.5px!important;flex-basis:4.5px!important}
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-name-v142{min-height:27px!important;margin:20px 3px 3px!important;font-size:9.3px!important}
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140{
    height:clamp(68px,24vw,100px)!important;min-height:68px!important;max-height:100px!important;
    margin:0 3px 4px!important;padding:4px!important;border-radius:9px!important
  }
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-img-v140,
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140 img.realm-card-img-v140{max-width:98%!important;max-height:98%!important}
  body[data-page="pets"] .tr340-card-value{margin:0 3px 4px!important}
  body[data-page="pets"] .tr340-card-origin{min-height:22px!important;margin:0 3px!important;padding:4px 5px!important;border-radius:6px!important;gap:4px!important}
  body[data-page="pets"] .tr340-card-origin small{min-height:13px!important;padding:2px 4px!important;font-size:3.8px!important}
  body[data-page="pets"] .tr340-card-origin strong{font-size:4.8px!important}
}
@media(max-width:390px){
  body[data-page="pets"] .tr232-collection-grid{gap:6px!important}
  body[data-page="pets"] .tr232-pet-collection-card .realm-card-art-v140{height:clamp(64px,23vw,88px)!important}
}
