/* Janela de prêmios e avisos animados (js/prizes.js): raios girando, ícone que pula, brilhos, recompensas que aparecem uma a uma.
   Também dá vida ao resultado da corrida (#rr-dialog). Tudo some com "reduzir movimento". */
.prize-overlay .confetti, #rr-dialog .confetti { z-index: 3; }
.pz-body { text-align: center; }

.pz-stage { position: relative; width: 190px; height: 170px; margin: 2px auto 6px; display: grid; place-items: center; }
.pz-rays {
  position: absolute;
  inset: -34px -34px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 90, 0.55) 0 9deg, rgba(255, 214, 90, 0) 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
  mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: pz-spin 16s linear infinite;
}
.pz-icon { position: relative; width: 130px; height: 130px; display: grid; place-items: center; }
.pz-icon svg { width: 100%; height: 100%; overflow: visible; }
.pz-icon .pz-fly, .pz-icon .pz-flame { display: block; width: 100%; height: 100%; }
.pz-icon .mark-cat { display: block; width: 100%; height: 100%; }
.pz-icon .pz-flame svg { filter: drop-shadow(0 0 10px rgba(255, 150, 40, 0.8)); animation: pz-flicker 0.9s ease-in-out infinite alternate; transform-origin: 50% 90%; }

.pz-spark { position: absolute; width: 14px; height: 14px; background: #fff3b0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; }
.pz-spark.s1 { left: 6px; top: 22px; }
.pz-spark.s2 { right: 4px; top: 10px; width: 18px; height: 18px; }
.pz-spark.s3 { left: 22px; bottom: 6px; width: 11px; height: 11px; }
.pz-spark.s4 { right: 18px; bottom: 14px; }

.pz-text { margin: 4px 0 10px; font-size: 1.02rem; line-height: 1.35; color: var(--text); }
.pz-rewards { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pz-rewards[hidden] { display: none; }
.pz-rewards li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: #fff3d6;
  border: 2px solid #f2c75a;
  color: #7a4a06;
  font-size: 1.02rem;
  box-shadow: 0 2px 0 #e0a82e;
}
.pz-rewards .gold { font-size: 1.35em; }
.pz-r-ico { display: inline-flex; font-size: 1.2rem; }
.pz-week { display: flex; justify-content: center; gap: 6px; margin: 2px 0 12px; }
.pz-week span {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #f1e4de; border: 2px solid #e2cfc6;
  font-size: 0.9rem; font-weight: 800; color: #fff;
}
.pz-week span.done { background: #f2b705; border-color: #c98a0a; }
.pz-week span.now { background: #ff9a2a; border-color: #d9631e; box-shadow: 0 0 0 4px rgba(255, 154, 42, 0.3); }
.pz-week span.gift { background: #fff3d6; border-color: #f2c75a; }
.pz-week span.gift.now { background: #ff9a2a; }
.pz-play .pz-week span { animation: pz-reward 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.35s + var(--k, 0) * 0.07s); }
.pz-play .pz-week span.now { animation: pz-reward 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both 0.9s, pz-beat 1s ease-in-out infinite 1.4s; }
.pz-later[hidden] { display: none; }
.pz-later { display: block; margin: 10px auto 0; padding: 4px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }

/* entra em cena toda vez que a janela abre (a classe pz-play é refeita em prizes.js) */
.pz-play .pz-icon { animation: pz-pop 0.75s cubic-bezier(0.3, 1.7, 0.5, 1) both 0.1s; }
.pz-play .pz-icon .gift-svg, .pz-play .pz-icon > svg { animation: pz-wiggle 1.6s ease-in-out infinite 0.9s; transform-origin: 50% 80%; }
.pz-play .pz-spark { animation: pz-twinkle 1.5s ease-in-out infinite; }
.pz-play .pz-spark.s2 { animation-delay: 0.4s; }
.pz-play .pz-spark.s3 { animation-delay: 0.8s; }
.pz-play .pz-spark.s4 { animation-delay: 1.1s; }
.pz-play .pz-rewards li { animation: pz-reward 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.55s + var(--i, 0) * 0.28s); }
.pz-play .pz-text { animation: pz-rise 0.5s ease-out both 0.35s; }
.pz-play .btn-play { animation: pz-rise 0.5s ease-out both 0.9s; }

/* resultado da corrida: o pódio ganha brilho e as linhas entram uma por uma */
#rr-dialog.podium .hang-banner { background-size: 200% 100%; animation: pz-shine 2.4s linear infinite; }
#rr-dialog.pz-play .race-row { animation: pz-rise 0.5s ease-out both; }
#rr-dialog.pz-play .race-row:nth-child(1) { animation-delay: 0.25s; }
#rr-dialog.pz-play .race-row:nth-child(2) { animation-delay: 0.45s; }
#rr-dialog.pz-play .race-row:nth-child(3) { animation-delay: 0.65s; }
#rr-dialog .pz-rewards { margin: 4px 0 12px; }
#rr-dialog.pz-play .pz-rewards li { animation-delay: 0.9s; }

@keyframes pz-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* Foguinho da sequência (FLAME_SVG): as três chamas balançam em ritmos diferentes e as brasas sobem */
.flame-art g { transform-box: fill-box; transform-origin: 50% 100%; }
.flame-art .fl-out { animation: fl-out 1.1s ease-in-out infinite alternate; }
.flame-art .fl-mid { animation: fl-mid 0.8s ease-in-out infinite alternate; }
.flame-art .fl-core { animation: fl-core 0.6s ease-in-out infinite alternate; }
.flame-art .fl-ember { animation: fl-ember 1.8s ease-in infinite; opacity: 0; }
.flame-art .fl-ember.e2 { animation-delay: 0.6s; }
.flame-art .fl-ember.e3 { animation-delay: 1.2s; animation-duration: 1.5s; }
.streak-chip:not(.lit) .flame-art * { animation-play-state: paused; }
@keyframes fl-out { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(0.97, 1.05) skewX(3deg); } 100% { transform: scale(1.02, 0.97) skewX(-3deg); } }
@keyframes fl-mid { 0% { transform: scale(1, 1) skewX(2deg); } 100% { transform: scale(0.96, 1.07) skewX(-3deg); } }
@keyframes fl-core { 0% { transform: scale(1); } 100% { transform: scale(0.9, 1.1); } }
@keyframes fl-ember { 0% { transform: translateY(6px) scale(0.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-16px) scale(1); opacity: 0; } }
@keyframes pz-spin { to { transform: rotate(360deg); } }
@keyframes pz-pop { 0% { transform: scale(0.2) rotate(-14deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes pz-wiggle { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-5deg); } 86% { transform: rotate(5deg); } 94% { transform: rotate(-3deg); } }
@keyframes pz-flicker { from { transform: scale(0.96) rotate(-2deg); } to { transform: scale(1.05) rotate(2deg); } }
@keyframes pz-twinkle { 0%, 100% { opacity: 0; transform: scale(0.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(90deg); } }
@keyframes pz-reward { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pz-rise { 0% { transform: translateY(14px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes pz-shine { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .flame-art g, .flame-art .fl-ember, .pz-rays, .pz-icon .pz-flame svg, .pz-play .pz-icon, .pz-play .pz-icon > svg, .pz-play .pz-spark, .pz-play .pz-rewards li, .pz-play .pz-week span, .pz-play .pz-text,
  .pz-play .btn-play, #rr-dialog.podium .hang-banner, #rr-dialog.pz-play .race-row { animation: none; }
  .pz-spark { opacity: 0.8; }
}

/* Prêmio do Ranking: medalha grande e o ícone do Mostrar (o vagalume da pessoa) */
.pz-medal { display: block; font-size: 5.2rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(120, 70, 0, 0.35)); }
.pz-reveal-ico { display: inline-block; width: 1.7rem; height: 1.7rem; }
.pz-reveal-ico .mark-cat { display: block; width: 100%; height: 100%; }
