/* Rank identity is shared by the map and the Hall of Fame. */
.trainer-identity[data-elo=bronze]{--elo:#e4ae84;--elo-dark:#70432d;--elo-light:#ffe1bd}
.trainer-identity[data-elo=prata]{--elo:#d6e5f1;--elo-dark:#5b6c80;--elo-light:#f4fbff}
.trainer-identity[data-elo=ouro]{--elo:#ffda78;--elo-dark:#8c651e;--elo-light:#fff2b3}
.trainer-identity[data-elo=platina]{--elo:#90e4ff;--elo-dark:#366e92;--elo-light:#e5faff}
.trainer-identity[data-elo=diamante]{--elo:#80dcff;--elo-dark:#2275b9;--elo-light:#edffff}
.trainer-identity[data-elo=mestre]{--elo:#e5aeff;--elo-dark:#733498;--elo-light:#f8dcff}
.trainer-identity[data-elo=desafiante]{--elo:#ffcb62;--elo-dark:#a25120;--elo-light:#fff1af}
.trainer-identity,.player-nameplate.trainer-identity{
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:5px;
  flex:0 0 auto;width:max-content;max-width:100%;min-height:30px;box-sizing:border-box;
  padding:2px 9px 2px 3px;border:1px solid var(--elo);border-radius:5px 10px 5px 10px;
  background:linear-gradient(120deg,#0c1e1bf5,#0b171bf2);color:var(--elo-light);
  box-shadow:inset 0 0 0 2px #050b1066,inset 0 -2px var(--elo-dark),0 2px 5px #0008;
  font:700 13px/1.25 'Segoe UI',Arial,sans-serif;white-space:nowrap;isolation:isolate;overflow:visible;
  text-shadow:0 1px 2px #000;vertical-align:middle;
}
.trainer-identity::before{content:'';position:absolute;inset:2px;border:1px solid color-mix(in srgb,var(--elo) 22%,transparent);border-radius:2px 7px 2px 7px;pointer-events:none;z-index:0}
.trainer-identity .trainer-nick{position:relative;z-index:1;font:inherit;color:var(--elo-light);white-space:nowrap;overflow:visible;text-overflow:clip;letter-spacing:.015em}
.elo-emblem{display:block;flex:0 0 auto;object-fit:contain;image-rendering:auto!important;filter:drop-shadow(0 2px 3px #0008)}
.trainer-identity .elo-emblem{position:relative;z-index:1;width:29px;height:29px;margin:-6px 0;object-fit:contain}
.trainer-identity .rank-hardcore{position:relative;z-index:1;display:block;width:12px;height:12px;flex:0 0 12px;fill:#efe4d6;shape-rendering:crispEdges}
#player-nameplates .player-nameplate.trainer-identity{position:absolute;font-size:clamp(11px,.85vw,14px);padding:2px 8px 2px 3px;min-height:27px;color:var(--elo-light);border-color:var(--elo);background:linear-gradient(120deg,#0c1e1bf5,#0b171bf2);text-overflow:clip;overflow:visible}
#player-nameplates .player-nameplate.trainer-identity .elo-emblem{width:30px;height:30px}
.trainer-identity[data-hunter-place="1"]{--flame:#ffc529;--flame-core:#fff8c2;--flame-deep:#f7780a}
.trainer-identity[data-hunter-place="2"]{--flame:#b9daef;--flame-core:#fff;--flame-deep:#7495bc}
.trainer-identity[data-hunter-place="3"]{--flame:#d98b52;--flame-core:#ffe0ac;--flame-deep:#9d4f27}
.trainer-identity:is([data-hunter-place="1"],[data-hunter-place="2"],[data-hunter-place="3"]){box-shadow:inset 0 -2px var(--elo-dark),0 0 6px color-mix(in srgb,var(--flame) 60%,transparent),0 0 17px color-mix(in srgb,var(--flame) 24%,transparent)}
.trainer-flames{position:absolute;inset:-5px -5px -3px;z-index:-1;pointer-events:none;border-radius:inherit;filter:drop-shadow(0 0 3px var(--flame));background:radial-gradient(ellipse at bottom,color-mix(in srgb,var(--flame) 23%,transparent),transparent 74%)}
.trainer-flames i{--drift:3px;position:absolute;bottom:0;left:var(--x);width:10px;height:19px;transform-origin:50% 100%;border-radius:80% 10% 60% 40%;background:radial-gradient(ellipse at 50% 95%,var(--flame-core) 0 12%,var(--flame) 35%,var(--flame-deep) 65%,transparent 78%);animation:nick-ember 1.45s ease-in-out infinite;animation-delay:var(--delay);opacity:.8}
.trainer-flames i:nth-child(1){--x:1%;--delay:-.2s;height:29px}
.trainer-flames i:nth-child(2){--x:14%;--delay:-.9s;height:30px}
.trainer-flames i:nth-child(3){--x:30%;--delay:-.5s;height:34px;--drift:-3px}
.trainer-flames i:nth-child(4){--x:44%;--delay:-1.2s;height:28px}
.trainer-flames i:nth-child(5){--x:59%;--delay:-.7s;height:33px;--drift:-3px}
.trainer-flames i:nth-child(6){--x:73%;--delay:-.1s;height:30px}
.trainer-flames i:nth-child(7){--x:90%;--delay:-1s;height:31px;--drift:-4px}
.trainer-flames i:nth-child(8){--x:96%;--delay:-.4s;height:26px;--drift:-5px}
@keyframes nick-ember{0%{transform:translateY(3px) rotate(-9deg) scale(.65,.75);opacity:.3}45%{transform:translate(var(--drift),-5px) rotate(9deg) scale(.9,1.1);opacity:.95}100%{transform:translate(0,-13px) rotate(-7deg) scale(.35,.65);opacity:0}}

/* Raster artwork keeps its own aspect ratio, independent of legacy pixel sprites. */
#screen #detail.rankings-panel .rank-crest.elo-emblem{width:76px;height:76px;object-fit:contain;background:none;image-rendering:auto!important}
#screen #detail.rankings-panel .rank-hero-crest>.elo-emblem{width:150px;height:150px;opacity:.85}
#screen #detail.rankings-panel .rank-podium-emblem{height:142px;margin:10px 0 14px;position:relative;display:flex;align-items:center;justify-content:center;gap:8px}
#screen #detail.rankings-panel .rank-trophy{width:auto;height:138px;max-width:100%;object-fit:contain;image-rendering:auto!important;filter:drop-shadow(0 8px 12px #0006)}
#screen #detail.rankings-panel .rank-podium-emblem canvas{position:absolute;right:-35px;bottom:0;width:48px!important;height:48px!important;filter:drop-shadow(0 3px 4px #0009)}
#screen #detail.rankings-panel .rank-podium-card{padding-bottom:20px}
#screen #detail.rankings-panel .rank-podium-card[data-place="2"]{border-color:#adc8db60;background:radial-gradient(ellipse at top,#95b6cd1c,transparent 75%),#142e2a}
#screen #detail.rankings-panel .rank-podium-card[data-place="3"]{border-color:#bc7e5555;background:radial-gradient(ellipse at top,#a4693a20,transparent 75%),#152d27}
#screen #detail.rankings-panel .rank-podium-caption{font-size:10px;letter-spacing:.1em}
#screen #detail.rankings-panel .rank-podium-detail{color:#bbd2c4;font-size:13px}
#screen #detail.rankings-panel .rank-name.trainer-identity{font-size:14px;line-height:1.3;overflow:visible}
#screen #detail.rankings-panel .trainer-nick{min-width:0;white-space:normal;overflow-wrap:anywhere}
#screen #detail.rankings-panel .trainer-identity .elo-emblem{width:29px;height:29px;min-width:29px;object-fit:contain}
#screen #detail.rankings-panel .rank-row-identity{overflow:visible}
#screen #detail.rankings-panel .rank-position .rank-trophy{width:32px;height:44px;margin:auto}
#screen #detail.rankings-panel .rank-row-emblem .elo-emblem{width:35px;height:38px;min-width:0}
#screen #detail.rankings-panel .rank-who{overflow:visible}
#screen #detail.rankings-panel .rank-who>.rank-row-emblem:empty{display:none}
#competitive-arena .arena-elo-art{width:80px;height:80px;margin:-10px 2px -5px 0}
#screen #battle.pvp-battle .pbh-owner .trainer-identity{display:inline-flex;align-items:center;flex-direction:row;font-size:12px;flex-shrink:0;letter-spacing:0}
#screen #battle.pvp-battle .pbh-owner .trainer-identity .elo-emblem{width:27px;height:27px}
#screen #battle.pvp-battle .pbh-owner .trainer-nick{min-width:0;white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){
  #screen #detail.rankings-panel .rank-podium{gap:8px}
  #screen #detail.rankings-panel .rank-podium-card{padding:12px 10px 18px}
  #screen #detail.rankings-panel .rank-podium-emblem{height:116px}
  #screen #detail.rankings-panel .rank-podium-emblem .rank-trophy{height:112px}
  #screen #detail.rankings-panel .rank-name.trainer-identity{font-size:12px;max-width:100%}
  #screen #detail.rankings-panel .rank-podium-card .trainer-identity{font-size:12px}
  #screen #detail.rankings-panel .rank-podium-emblem canvas{right:-29px;width:40px!important;height:40px!important}
  #screen #battle.pvp-battle .pbh-owner .trainer-identity{font-size:10px;min-height:24px;padding-right:5px;gap:3px}
  #screen #battle.pvp-battle .pbh-owner .trainer-identity .elo-emblem{width:24px;height:24px}
}
@media(prefers-reduced-motion:reduce){.trainer-flames i{animation:none;opacity:.35;transform:scale(.65,.75)}}
@media(orientation:landscape) and (max-height:520px) and (min-width:701px){
  #screen #detail.rankings-panel .rank-podium-emblem{height:76px;margin:4px 0 8px}
  #screen #detail.rankings-panel .rank-podium-emblem .rank-trophy{height:74px}
  #screen #detail.rankings-panel .rank-podium-card{padding:10px 12px 12px}
  #screen #detail.rankings-panel .rank-podium-card .trainer-identity{font-size:12px}
  #screen #detail.rankings-panel .rank-podium-caption{font-size:9px}
}
body:has(#overlay:not([hidden])) #player-nameplates .trainer-flames i,body:has(#competitive-arena[open]) #player-nameplates .trainer-flames i{animation-play-state:paused}
