/* Emblemas dos elos (arte em PNG) com brilho. Gerados por {% emblema %} em gamificacao/templatetags/elos.py.
   --t: tamanho em px; --elo-cor: cor do brilho; --elo-mascara: a própria imagem, para o reflexo seguir o formato. */

.elo-arte {
  --elo-brilho: var(--elo-cor);
  --elo-forca: 1;
  position: relative; display: inline-block; vertical-align: middle; flex: none;
  width: var(--t); height: var(--t); line-height: 0;
}
.elo-arte img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  filter: drop-shadow(0 0 calc(var(--t) * .05 * var(--elo-forca)) color-mix(in srgb, var(--elo-brilho) 75%, transparent));
}

/* cor do brilho de cada elo, tirada da arte (vale também se as cores do painel mudarem) */
.elo-ferro     { --elo-brilho: #a3acb7; --elo-forca: .7; }
.elo-bronze    { --elo-brilho: #e8964f; --elo-forca: .8; }
.elo-prata     { --elo-brilho: #d5dde7; --elo-forca: .9; }
.elo-ouro      { --elo-brilho: #f5c542; --elo-forca: .95; }
.elo-esmeralda { --elo-brilho: #34d399; --elo-forca: 1; }
.elo-rubi      { --elo-brilho: #fb5a76; --elo-forca: 1.1; }
.elo-diamante  { --elo-brilho: #4cc9ff; --elo-forca: 1.25; }
.elo-obsidiana { --elo-brilho: #b06cff; --elo-forca: 1.4; }

/* reflexo de luz que atravessa a medalha (recortado no formato da arte) */
.elo-animado::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0;
  -webkit-mask: var(--elo-mascara) center / contain no-repeat;
          mask: var(--elo-mascara) center / contain no-repeat;
  mix-blend-mode: overlay;
  animation: elo-reflexo 5s ease-in-out infinite;
}
/* o brilho em volta "respira" */
.elo-animado img { animation: elo-pulso 3.2s ease-in-out infinite; }

@keyframes elo-reflexo {
  0%, 55% { background-position: 160% 0; }
  85%, 100% { background-position: -60% 0; }
}
@keyframes elo-pulso {
  50% {
    filter: drop-shadow(0 0 calc(var(--t) * .11 * var(--elo-forca)) color-mix(in srgb, var(--elo-brilho) 90%, transparent));
  }
}

/* cada elo da vitrine reflete num momento diferente */
.elos-vitrine li:nth-child(2) .elo-animado::after, .lp-elos li:nth-child(2) .elo-animado::after { animation-delay: .6s; }
.elos-vitrine li:nth-child(3) .elo-animado::after, .lp-elos li:nth-child(3) .elo-animado::after { animation-delay: 1.2s; }
.elos-vitrine li:nth-child(4) .elo-animado::after, .lp-elos li:nth-child(4) .elo-animado::after { animation-delay: 1.8s; }
.elos-vitrine li:nth-child(5) .elo-animado::after, .lp-elos li:nth-child(5) .elo-animado::after { animation-delay: 2.4s; }
.elos-vitrine li:nth-child(6) .elo-animado::after, .lp-elos li:nth-child(6) .elo-animado::after { animation-delay: 3s; }
.elos-vitrine li:nth-child(7) .elo-animado::after, .lp-elos li:nth-child(7) .elo-animado::after { animation-delay: 3.6s; }
.elos-vitrine li:nth-child(8) .elo-animado::after, .lp-elos li:nth-child(8) .elo-animado::after { animation-delay: 4.2s; }

/* moldura do avatar (PNG): leve brilho na cor do elo */
.moldura-arte { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--brilho) 70%, transparent)); }

@media (prefers-reduced-motion: reduce) {
  .elo-animado::after, .elo-animado img { animation: none; }
}

/* ---------------------------------------------------------------- pódio: dog tags ({% posicao %} em elos.py)
   Balançam presas na corrente, o brilho em volta respira e um reflexo atravessa a placa, como nos elos. */
.dt { display: inline-block; vertical-align: middle; line-height: 0; flex: none; }
.dt svg {
  display: block; overflow: visible; transform-origin: 50% 0;
  filter: drop-shadow(0 0 calc(var(--t) * .06) color-mix(in srgb, var(--dt-brilho) 70%, transparent));
  animation: dt-balanco 4s ease-in-out infinite, dt-pulso 3.2s ease-in-out infinite;
}
.dt-reflexo { animation: dt-reflexo 5s ease-in-out infinite; }
.dt-prata svg, .dt-prata .dt-reflexo { animation-delay: -1.3s; }
.dt-bronze svg, .dt-bronze .dt-reflexo { animation-delay: -2.6s; }
.ga-posicao:has(> .dt) { background: none; }

@keyframes dt-balanco {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes dt-pulso {
  50% { filter: drop-shadow(0 0 calc(var(--t) * .14) color-mix(in srgb, var(--dt-brilho) 90%, transparent)); }
}
@keyframes dt-reflexo {
  0%, 55% { transform: skewX(-18deg) translateX(0); }
  85%, 100% { transform: skewX(-18deg) translateX(62px); }
}

@media (prefers-reduced-motion: reduce) {
  .dt svg, .dt-reflexo { animation: none; }
}
