/* Animação do acerto + ultrapassagem (V.267) — src/scripts/jornada/acertoAnimacao.js. Proposta aprovada em 19/10/2026. */
.ac-fundo {
  position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: rgba(16, 28, 24, .62); opacity: 0; transition: opacity .45s ease;
}
.ac-fundo.is-visivel { opacity: 1; }
.ac-card {
  --ac-lv1: #5ea9ab; --ac-lv2: #1c5359;
  width: min(370px, 100%); background: #fff; color: #1c2b26; border-radius: 22px; padding: 18px 18px 20px;
  display: grid; gap: 12px; position: relative; overflow: hidden; font-family: inherit;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
  transform: translateY(28px) scale(.94); opacity: 0; filter: blur(4px);
  transition: transform .7s cubic-bezier(.16, 1, .3, 1), opacity .5s ease, filter .5s ease;
}
.ac-fundo.is-visivel .ac-card { transform: none; opacity: 1; filter: none; transition-delay: .12s; }
.ac-topo { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; } /* V.272: escudo sempre no centro */
/* V.278: a área do escudo tem tamanho FIXO (cabe o escudo do nível novo, 35% maior) — o cartão não cresce na troca */
.ac-escudo { display: flex; align-items: center; justify-content: center; width: 240px; max-width: 100%; height: 108px; position: relative; transform: scale(.5) rotate(-10deg); opacity: 0; transition: transform .7s cubic-bezier(.2, 1.3, .3, 1) .35s, opacity .3s .35s; }
.ac-fundo.is-visivel .ac-escudo { transform: none; opacity: 1; }
.ac-escudo svg { display: block; }
.ac-ganho { font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ac-lv2); }
.ac-nivel { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 1.4em; } /* V.278: uma linha só (o cartão não cresce) */
.ac-barra { height: 14px; background: #e8f0ec; border-radius: 999px; position: relative; }
.ac-ghost, .ac-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.ac-ghost { background: color-mix(in srgb, var(--ac-lv1) 35%, transparent); transition: width .35s ease; }
.ac-fill {
  background: linear-gradient(90deg, var(--ac-lv2), var(--ac-lv1));
  box-shadow: 0 0 12px color-mix(in srgb, var(--ac-lv1) 55%, transparent);
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1);
}
.ac-fill::after {
  content: ""; position: absolute; right: -2px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0, color-mix(in srgb, var(--ac-lv1) 40%, #fff) 35%, transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.ac-barra.is-andando .ac-fill::after { opacity: 1; }
.ac-faisca { position: absolute; width: 5px; height: 5px; border-radius: 50%; pointer-events: none; background: color-mix(in srgb, var(--ac-lv1) 40%, #fff); animation: ac-faisca .7s ease-out forwards; }
@keyframes ac-faisca { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--x), var(--y)); opacity: 0; } }
.ac-total { display: flex; justify-content: flex-end; font-size: 12px; color: #5c6066; font-weight: 700; font-variant-numeric: tabular-nums; }
.ac-sep { height: 1px; background: #dbe4df; }
.ac-rk-titulo { font-size: 13px; font-weight: 800; }
/* V.272: a janela corta só em cima e embaixo (rolagem); as laterais ganham folga para a borda e a sombra da linha não serem cortadas */
.ac-lista { position: relative; overflow: hidden; margin: -10px -12px 0; padding: 10px 12px 0; box-sizing: border-box; }
.ac-lista.tem-acima { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }
.ac-lista.tem-abaixo { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 16px); mask-image: linear-gradient(to top, transparent 0, #000 16px); }
.ac-lista.tem-acima.tem-abaixo { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 16px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 16px), transparent 100%); }
.ac-trilho { position: relative; will-change: transform; }
.ac-linha {
  position: absolute; left: 0; right: 0; height: 40px; display: grid; grid-template-columns: 32px 30px 1fr auto; gap: 9px; align-items: center;
  padding: 0 10px; border-radius: 12px; background: #f3f6f4; overflow: hidden;
  transition: top .9s cubic-bezier(.3, 1.1, .4, 1), box-shadow .3s, opacity .3s, background .4s;
}
.ac-pos { font-weight: 800; font-variant-numeric: tabular-nums; color: #5c6066; font-size: 13px; display: grid; place-items: center end; }
.ac-linha .ac-av { width: 28px; height: 28px; font-size: 10px; position: relative; overflow: visible; }
.ac-nome { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ac-nome small { font-weight: 600; color: #5c6066; margin-left: 5px; }
.ac-xp { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--green-900); }
.ac-linha.is-eu { background: #fff6e6; box-shadow: 0 0 0 2px #c9822b; z-index: 2; }
.ac-linha.is-eu.is-voando { box-shadow: 0 10px 24px rgba(0, 0, 0, .2), 0 0 0 2px #c9822b; }
.ac-linha.is-passado { opacity: .72; }
.ac-pos.is-troca { animation: ac-troca .35s ease; }
@keyframes ac-troca { 40% { transform: scale(1.35); color: #2f8f5b; } }
/* pódio */
.ac-linha.is-p1 { --m1: #ffe08a; --m2: #d9a21b; --m3: #8a6206; }
.ac-linha.is-p2 { --m1: #f1f4f7; --m2: #a9b4bf; --m3: #5b6672; }
.ac-linha.is-p3 { --m1: #f6c9a3; --m2: #c47a3f; --m3: #7c4519; }
.ac-linha.is-podio {
  background: linear-gradient(100deg, color-mix(in srgb, var(--m1) 70%, #fff) 0%, color-mix(in srgb, var(--m2) 22%, #fff) 100%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--m2) 70%, transparent);
}
.ac-linha.is-podio .ac-av { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--m2); }
.ac-linha.is-podio .ac-xp { color: var(--m3); }
.ac-linha.is-eu.is-podio { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--m2) 70%, transparent), 0 0 0 2px #c9822b; }
.ac-linha.is-p1 { height: 42px; margin-top: -1px; }
.ac-linha.is-p1 .ac-av { width: 31px; height: 31px; }
.ac-linha.is-podio::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%); transform: translateX(-120%);
}
.ac-linha.is-podio.is-brilha::before { animation: ac-brilho 1s ease-out; }
@keyframes ac-brilho { to { transform: translateX(120%); } }
.ac-medalha { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.ac-medalha.is-entra { animation: ac-medalha .6s cubic-bezier(.2, 1.5, .3, 1); }
@keyframes ac-medalha { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: none; } }
.ac-coroa { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 16px; height: 11px; }
.ac-estrela {
  position: absolute; width: 6px; height: 6px; pointer-events: none; z-index: 3;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: ac-estrela .8s ease-out forwards;
}
@keyframes ac-estrela { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(.4); opacity: 0; } }
.ac-tempo { position: absolute; left: 18px; right: 18px; bottom: 7px; height: 3px; border-radius: 3px; background: #e8f0ec; overflow: hidden; }
.ac-tempo i { display: block; height: 100%; width: 100%; background: var(--green-700); transform-origin: left; animation: ac-tempo var(--ac-dur, 4500ms) linear forwards; }
@keyframes ac-tempo { to { transform: scaleX(0); } }

/* V.269: novo nível no mesmo cartão + fechar voando para a foto do perfil */
.ac-escudo.is-troca svg { animation: ac-escudo-troca .8s cubic-bezier(.2, 1.4, .3, 1); }
/* V.271: no novo nível o escudo vai para o centro, maior */
/* V.271: empate fora do pódio — cor própria, leve */
.ac-linha.is-empate { background: #eceefc; box-shadow: inset 0 0 0 1.5px #c3c7f2; }
.ac-linha.is-empate .ac-pos { color: #4f55c4; }
.ac-linha.is-eu.is-empate { background: linear-gradient(100deg, #eceefc, #fff6e6); box-shadow: inset 0 0 0 1.5px #c3c7f2, 0 0 0 2px #c9822b; }
@keyframes ac-escudo-troca { 0% { transform: scale(.3) rotate(-25deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: none; } }
.ac-nivel.is-novo { color: var(--ac-lv2); animation: ac-novo .6s ease; }
@keyframes ac-novo { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
.ac-card.is-novo-nivel { box-shadow: 0 20px 50px rgba(0, 0, 0, .28), 0 0 0 3px color-mix(in srgb, var(--ac-lv1) 60%, transparent); }
.ac-confete { position: absolute; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; z-index: 4; animation: ac-confete 1.2s ease-out forwards; }
@keyframes ac-confete { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(540deg); opacity: 0; } }
#profileButton.ac-pulso { animation: ac-pulso .7s ease; }
@keyframes ac-pulso { 0% { transform: scale(1); } 35% { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(201, 130, 43, .35); } 100% { transform: scale(1); } }

/* V.273: festa em tela cheia (festa.js) e esteira do escudo no novo nível */
.ac-festa { position: fixed; inset: 0; z-index: 9500; pointer-events: none; }
.ac-escudo.is-esteira { overflow: hidden; display: block; height: 168px; margin: -30px 0; /* V.278: área 30px maior em cima e embaixo (asas não cortam), sem mudar o tamanho do cartão */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 78%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 78%, transparent 100%); }
.ac-esteira { position: absolute; top: 0; bottom: 0; left: calc(50% - 38px); display: flex; align-items: center; gap: 72px; will-change: transform; }
.ac-esteira-item { flex: 0 0 auto; display: block; }
.ac-esteira-item svg { display: block; }
.ac-esteira-item { position: relative; transform-origin: 50% 60%; }
.ac-esteira-item.is-brilho::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%); transform: translateX(-120%); animation: ac-brilho-escudo .7s ease-out forwards; -webkit-mask: radial-gradient(circle at 50% 50%, #000 60%, transparent 72%); mask: radial-gradient(circle at 50% 50%, #000 60%, transparent 72%); }
@keyframes ac-brilho-escudo { to { transform: translateX(120%); } }
.ac-clarao { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--ac-lv1) 70%, #fff) 0, color-mix(in srgb, var(--ac-lv1) 35%, transparent) 40%, transparent 70%); animation: ac-clarao .85s ease-out forwards; }
@keyframes ac-clarao { 0% { transform: scale(.3); opacity: 0; } 30% { opacity: .95; } 100% { transform: scale(1.6); opacity: 0; } }

/* painel da simulação (só admin, ?simular=acerto) */
.ac-sim {
  position: fixed; z-index: 8000; left: max(14px, env(safe-area-inset-left, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px));
  width: min(300px, calc(100vw - 28px)); background: #fff; border: 2px solid #c9822b; border-radius: 16px; padding: 14px;
  display: grid; gap: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); font-size: 13px;
}
.ac-sim-titulo { font-size: 13px; color: #8a5a12; }
.ac-sim-texto { margin: 0; color: #5c6066; font-size: 12px; line-height: 1.4; }
.ac-sim-botoes { display: grid; gap: 6px; }
.ac-sim-btn, .ac-sim-sair { font: inherit; font-weight: 700; padding: 9px 12px; border-radius: 999px; border: 0; cursor: pointer; text-align: left; }
.ac-sim-btn { background: var(--green-900); color: #fff; }
.ac-sim-sair { background: #e8f0ec; color: var(--green-900); text-align: center; }
.ac-sim-btn:focus-visible, .ac-sim-sair:focus-visible, .ac-sim-nivel:focus-visible { outline: 3px solid #c9822b; outline-offset: 2px; }
.ac-sim-niveis { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ac-sim-sub { width: 100%; font-size: 12px; font-weight: 700; color: #5c6066; }
.ac-sim-nivel { font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--green-900); background: #fff; color: var(--green-900); cursor: pointer; }
@media (max-width: 600px) { .ac-sim { max-height: 46vh; overflow-y: auto; } }

@media (prefers-reduced-motion: reduce) {
  .ac-fundo, .ac-card, .ac-escudo, .ac-fill, .ac-ghost, .ac-linha { transition-duration: .001s !important; transition-delay: 0s !important; }
  .ac-medalha.is-entra, .ac-pos.is-troca, .ac-linha.is-brilha::before, .ac-escudo.is-troca, .ac-nivel.is-novo, #profileButton.ac-pulso { animation: none !important; }
}

/* V.288: botão da simulação com a Liga de verdade */
.ac-sim-btn--real { color: #fff; background: var(--green-900); border-color: var(--green-900); font-weight: 800; }
