/* A foto tem área quadrada fixa em todas as graduações.
   Só a arte da moldura é calibrada pelo recorte transparente de cada PNG.
   Os 3px sob a borda evitam frestas de antialiasing. */
.st2-personagem-img-wrap .dash-avatar-wrap { position:absolute; inset:0; width:100%; height:100%; }
.st2-personagem-img-wrap { overflow:visible; }
:is(.dash-avatar-wrap, .rnk-frame, .pvpon-frame, .camp-frame) {
  container-type:size; overflow:visible; border-radius:0;
  --frame-w:1254; --frame-h:1254;
  --hole-x:258; --hole-y:263; --hole-w:736; --hole-h:708;
  --frame-image:url('../img/molduras/20260927-anbu/moldura-anbu.png');
}
.moldura-akatsuki { --frame-w: 1254; --frame-h: 1254; --hole-x: 250; --hole-y: 371; --hole-w: 759; --hole-h: 748; --frame-image:url('../img/molduras/20260927-anbu/moldura-akatsuki.png'); }
.moldura-anbu { --frame-w: 1254; --frame-h: 1254; --hole-x: 258; --hole-y: 263; --hole-w: 736; --hole-h: 708; --frame-image:url('../img/molduras/20260927-anbu/moldura-anbu.png'); }
.moldura-chunin { --frame-w: 1254; --frame-h: 1254; --hole-x: 249; --hole-y: 213; --hole-w: 779; --hole-h: 746; --frame-image:url('../img/molduras/20260927-anbu/moldura-chunin.png'); }
.moldura-estudante { --frame-w: 1254; --frame-h: 1254; --hole-x: 247; --hole-y: 209; --hole-w: 760; --hole-h: 777; --frame-image:url('../img/molduras/20260927-anbu/moldura-estudante.png'); }
.moldura-genin { --frame-w: 1254; --frame-h: 1254; --hole-x: 246; --hole-y: 182; --hole-w: 763; --hole-h: 797; --frame-image:url('../img/molduras/20260927-anbu/moldura-genin.png'); }
.moldura-jinchuuriki { --frame-w: 1254; --frame-h: 1254; --hole-x: 226; --hole-y: 292; --hole-w: 817; --hole-h: 782; --frame-image:url('../img/molduras/20260927-anbu/moldura-jinchuuriki.png'); }
.moldura-jonin { --frame-w: 1254; --frame-h: 1254; --hole-x: 237; --hole-y: 202; --hole-w: 781; --hole-h: 792; --frame-image:url('../img/molduras/20260927-anbu/moldura-jonin.png'); }
.moldura-kage { --frame-w: 1254; --frame-h: 1254; --hole-x: 194; --hole-y: 276; --hole-w: 866; --hole-h: 824; --frame-image:url('../img/molduras/20260927-anbu/moldura-kage.png'); }
.moldura-otsutsuki { --frame-w: 1254; --frame-h: 1254; --hole-x: 187; --hole-y: 286; --hole-w: 856; --hole-h: 787; --frame-image:url('../img/molduras/20260927-anbu/moldura-otsutsuki.png'); }
.moldura-sannin { --frame-w: 1254; --frame-h: 1254; --hole-x: 275; --hole-y: 370; --hole-w: 697; --hole-h: 723; --frame-image:url('../img/molduras/20260927-anbu/moldura-sannin.png'); }
.moldura-seis-caminhos { --frame-w: 1254; --frame-h: 1254; --hole-x: 208; --hole-y: 198; --hole-w: 838; --hole-h: 799; --frame-image:url('../img/molduras/20260927-anbu/moldura-seis-caminhos.png'); }
.moldura-shibai { --frame-w: 1254; --frame-h: 1254; --hole-x: 158; --hole-y: 249; --hole-w: 918; --hole-h: 821; --frame-image:url('../img/molduras/20260927-anbu/shibai.png'); }

:is(.dash-avatar-wrap, .rnk-frame, .pvpon-frame, .camp-frame)[class] >
:is(.st2-foto, .st2-emoji-fallback, .rnk-frame-foto, .rnk-frame-emoji,
    .pvpon-frame-foto, .pvpon-frame-emoji, .camp-frame-foto, .camp-frame-emoji) {
  --portrait-side:min(64cqw,64cqh);
  position:absolute; inset:auto;
  left:calc((100cqw - var(--portrait-side)) / 2);
  top:calc((100cqh - var(--portrait-side)) / 2);
  width:var(--portrait-side); height:var(--portrait-side);
  max-width:none; max-height:none; border:0; border-radius:0; padding:0; margin:0;
  object-fit:cover; object-position:center; z-index:1;
}
/* Nove regiões: preserva a proporção dos cantos/personagens e ajusta
   apenas os trechos de borda à abertura quadrada. O centro mantém alpha. */
:is(.dash-avatar-wrap, .rnk-frame, .pvpon-frame, .camp-frame)[class] >
:is(.dash-avatar-moldura, .rnk-frame-moldura, .pvpon-frame-moldura, .camp-frame-moldura, .rh-profile-border) {
  /* Atualizações legadas podem definir display inline; só o ::after desenha a moldura. */
  display:none !important;
}
:is(.dash-avatar-wrap, .rnk-frame, .pvpon-frame, .camp-frame)[class]::after {
  content:""; --portrait-side:min(64cqw,64cqh);
  --art-scale:min(calc(var(--portrait-side) / var(--hole-w)),calc(var(--portrait-side) / var(--hole-h)));
  --cut-right:calc(var(--frame-w) - var(--hole-x) - var(--hole-w));
  --cut-bottom:calc(var(--frame-h) - var(--hole-y) - var(--hole-h));
  position:absolute; box-sizing:content-box;
  width:var(--portrait-side); height:var(--portrait-side);
  left:calc((100cqw - var(--portrait-side)) / 2 - var(--hole-x) * var(--art-scale));
  top:calc((100cqh - var(--portrait-side)) / 2 - var(--hole-y) * var(--art-scale));
  border-style:solid; border-color:transparent;
  border-width:calc(var(--hole-y) * var(--art-scale)) calc(var(--cut-right) * var(--art-scale)) calc(var(--cut-bottom) * var(--art-scale)) calc(var(--hole-x) * var(--art-scale));
  border-image-source:var(--frame-image);
  /* Percentuais permanecem corretos ao reduzir o PNG, por exemplo para 380x380. */
  border-image-slice:calc(var(--hole-y) / var(--frame-h) * 100%) calc(var(--cut-right) / var(--frame-w) * 100%) calc(var(--cut-bottom) / var(--frame-h) * 100%) calc(var(--hole-x) / var(--frame-w) * 100%) fill;
  border-image-width:1; border-image-repeat:stretch;
  z-index:3; pointer-events:none;
}
.st2-personagem-img-wrap .dash-avatar-upload { width:100%; height:100%; border-radius:0; }
