/* Mapa jogadores ↔ VMs (templates/vitrine/mapa.html). O estado final é o estilo base:
   as animações só partem de "desligado" até ele, então menos movimento = quadro final parado.
   Suas VMs são blocos de tinta com LED laranja; as dos outros, papel cinza. */
.mapa-svg { display: block; width: 100%; height: auto; padding: 12px 10px 6px; font-family: var(--fonte-texto); }

.raia { fill: var(--fundo-2); stroke: var(--borda-forte); stroke-width: 1; stroke-dasharray: 4 5; }
.raia-sua { fill: var(--fundo); stroke: var(--borda); stroke-dasharray: none; }

.fio { fill: none; stroke: var(--borda-forte); stroke-width: 2; }
.fluxo {
  fill: none; stroke: var(--destaque); stroke-width: 3.4; stroke-linecap: round;
  stroke-dasharray: .1 11; animation: aparecer .5s ease 2s both, fluxo 1.4s linear infinite;
}
.fluxo-outro { stroke: var(--borda-forte); stroke-dasharray: .1 24; animation: aparecer .5s ease 1.3s both, fluxo-longo 2.2s linear infinite; }
.fluxo-outro-2 { animation: aparecer .5s ease 1.5s both, fluxo-longo 2.9s linear infinite; }

.vm-caixa { fill: var(--tinta); stroke: var(--tinta); stroke-width: 1.2; }
.vm-outra .vm-caixa { fill: var(--fundo); stroke: var(--borda-forte); }
.led { fill: var(--destaque); }
.vm-outra .led { fill: var(--borda-forte); }
.vm-nome { fill: var(--sobre-tinta); font-size: 13px; font-weight: 700; font-stretch: 112%; }
.vm-ip { fill: var(--sobre-tinta-suave); font-size: 11px; }
.vm-outra .vm-nome { fill: var(--texto); }
.vm-outra .vm-ip { fill: var(--texto-suave); }
.vm-on { fill: var(--destaque); font-size: 11px; font-weight: 700; font-family: var(--fonte-dados); }

.jogador-anel { fill: var(--fundo); stroke: var(--borda-forte); stroke-width: 2; }
.jogador-cabeca { fill: var(--texto-suave); }
.jogador-corpo { fill: none; stroke: var(--texto-suave); stroke-width: 2.4; stroke-linecap: round; }
.jogador-voce .jogador-anel { fill: var(--fundo); stroke: var(--texto); stroke-width: 2.5; }
.jogador-voce .jogador-cabeca { fill: var(--texto); }
.jogador-voce .jogador-corpo { stroke: var(--texto); }
.rotulo-voce { fill: var(--texto); font-size: 13px; font-weight: 800; font-stretch: 115%; }
.rotulo-outro { fill: var(--texto-suave); font-size: 10px; }

.cadeado circle { fill: var(--fundo); stroke: var(--borda-forte); stroke-width: 1.2; }
.cadeado rect { fill: var(--texto); }
.cadeado path { fill: none; stroke: var(--texto); stroke-width: 1.6; }

/* Sequência: os fios se desenham, cada VM liga, o fluxo começa, os cadeados fecham. */
.fio-1, .fio-2, .fio-3, .fio-4 { animation: desenhar .8s cubic-bezier(.4, 0, .2, 1) both; }
.vm { transform-box: fill-box; transform-origin: center; animation: ligar-vm .7s cubic-bezier(.2, .9, .3, 1.3) both; }
.led { transform-box: fill-box; transform-origin: center; animation: led 2.6s ease-in-out infinite; }
.vm-1, .fio-1, .fluxo-1 { --i: 0; }
.vm-2, .fio-2, .fluxo-2 { --i: 1; }
.vm-3, .fio-3, .fluxo-3 { --i: 2; }
.vm-4, .fio-4, .fluxo-4 { --i: 3; }
.fio-1, .fio-2, .fio-3, .fio-4 { animation-delay: calc(.8s + var(--i) * .2s); }
.vm-1, .vm-2, .vm-3, .vm-4 { animation-delay: calc(1.25s + var(--i) * .2s); }
.vm-outra { animation-delay: .9s; }
.vm-outra-2 { animation-delay: 1.1s; }
.vm-2 .led { animation-delay: .6s; }
.vm-3 .led { animation-delay: 1.2s; }
.vm-4 .led { animation-delay: 1.8s; }
.cadeado { transform-box: fill-box; transform-origin: center; animation: trancar .6s cubic-bezier(.2, .9, .3, 1.5) 2.2s both; }
.jogador-voce { transform-box: fill-box; transform-origin: center; animation: ligar-vm .8s cubic-bezier(.2, .9, .3, 1.3) .55s both; }

@keyframes desenhar { from { stroke-dasharray: 100; stroke-dashoffset: 100; } to { stroke-dasharray: 100; stroke-dashoffset: 0; } }
@keyframes ligar-vm { from { opacity: 0; transform: translateX(-8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes fluxo { to { stroke-dashoffset: -11.1; } }
@keyframes led { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.8); } }
@keyframes trancar { from { opacity: 0; transform: scale(.4) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes fluxo-longo { to { stroke-dashoffset: -24.1; } }

@media (prefers-reduced-motion: reduce) {
  .fio, .fluxo, .vm, .led, .cadeado, .chip-ponto, .jogador-voce { animation: none !important; }
}
