/* ==========================================================================
   ANAEROBIC ARCADE - victory.css
   Tela final de premiação (somente #screen-victory)
   Animações leves: apenas transform / opacity (aceleradas por GPU).
   ========================================================================== */

.victory-screen {
  --tier-main: #ffd200;
  --tier-glow: rgba(255, 210, 0, 0.75);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  margin: auto 0;
  padding: 6px 0 10px;
  width: 100%;
}
.victory-screen[data-tier="bronze"]   { --tier-main: #ff9a4d; --tier-glow: rgba(255, 140, 60, 0.75); }
.victory-screen[data-tier="silver"]   { --tier-main: #cfe3ff; --tier-glow: rgba(190, 215, 255, 0.75); }
.victory-screen[data-tier="gold"]     { --tier-main: #ffd200; --tier-glow: rgba(255, 210, 0, 0.75); }
.victory-screen[data-tier="platinum"] { --tier-main: #8ff3ff; --tier-glow: rgba(143, 243, 255, 0.85); }

/* Flash de entrada */
.victory-flash {
  position: absolute; inset: -24px; z-index: 5; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, var(--tier-main) 45%, transparent 75%);
  opacity: 0;
  animation: vFlash 0.7s ease-out 0.05s both;
}
@keyframes vFlash { 0% { opacity: 0.9; } 100% { opacity: 0; } }

/* VICTORY! */
.victory-title {
  font-family: var(--font-pixel);
  font-size: clamp(34px, 9vw, 58px);
  line-height: 1.05;
  color: var(--neon-yellow);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #b45309, 6px 6px 0 #000, 0 0 18px rgba(255, 230, 0, 0.9), 0 0 38px rgba(255, 230, 0, 0.55);
  animation: vTitleSlam 0.7s cubic-bezier(.2, 1.4, .4, 1) 0.1s both, vNeon 2.6s steps(1) 0.9s infinite;
}
@keyframes vTitleSlam {
  0%   { opacity: 0; transform: scale(3) translateY(-20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes vNeon {
  0%, 100% { opacity: 1; }
  46% { opacity: 1; } 47% { opacity: 0.78; } 48% { opacity: 1; } 49% { opacity: 0.85; } 50% { opacity: 1; }
}

.victory-rank {
  font-family: var(--font-pixel);
  font-size: clamp(11px, 3vw, 15px);
  letter-spacing: 1px;
  padding: 5px 12px;
  color: var(--tier-main);
  background: rgba(10, 4, 24, 0.85);
  border: 2px solid var(--tier-main);
  box-shadow: 0 3px 0 #000, 0 0 14px var(--tier-glow);
  animation: vFadeUp 0.5s ease-out 0.95s both;
}

/* Palco: Daniel | medalha | Henrique */
.victory-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  justify-items: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
}
.victory-char { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: vFadeUp 0.5s ease-out 0.6s both; }
.victory-stage .end-sprite-box { filter: drop-shadow(0 0 8px rgba(157, 78, 221, 0.6)); }

.medal-wrap {
  position: relative;
  width: clamp(116px, 34vw, 176px);
  aspect-ratio: 21 / 21;
  display: flex; align-items: center; justify-content: center;
}
.medal-rays {
  position: absolute; left: 50%; top: 50%;
  width: 150%; aspect-ratio: 1; margin: -75% 0 0 -75%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--tier-glow) 0deg 8deg, transparent 8deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
          mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  opacity: 0;
  animation: vFadeIn 0.8s ease-out 1.5s forwards, vSpin 14s linear 1.5s infinite;
}
@keyframes vSpin { to { transform: rotate(360deg); } }
@keyframes vFadeIn { to { opacity: 0.55; } }

.medal-art {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 12px var(--tier-glow));
  animation: vMedalReveal 1s cubic-bezier(.2, 1.2, .35, 1) 1.1s both, vMedalFloat 2.4s ease-in-out 2.2s infinite;
}
.medal-art svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.victory-screen[data-tier="platinum"] .medal-art svg { animation: vShimmer 4s linear infinite; }
@keyframes vShimmer { 0%, 100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(60deg); } }
@keyframes vMedalReveal {
  0%   { opacity: 0; transform: scale(0) rotate(-200deg); }
  55%  { opacity: 1; transform: scale(1.3) rotate(12deg); }
  78%  { transform: scale(0.94) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes vMedalFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Brilhos em pixel art ao redor da medalha */
.medal-sparkles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.medal-sparkles i {
  position: absolute; width: 4px; height: 4px; background: #fff;
  box-shadow: 4px 0 #fff, -4px 0 #fff, 0 4px #fff, 0 -4px #fff;
  opacity: 0; transform: scale(0);
  animation: vTwinkle 1.8s ease-in-out infinite;
}
.medal-sparkles i:nth-child(1) { left: 6%;  top: 18%; animation-delay: 2.0s; }
.medal-sparkles i:nth-child(2) { left: 92%; top: 24%; animation-delay: 2.5s; background: var(--neon-cyan); box-shadow: 4px 0 var(--neon-cyan), -4px 0 var(--neon-cyan), 0 4px var(--neon-cyan), 0 -4px var(--neon-cyan); }
.medal-sparkles i:nth-child(3) { left: 14%; top: 78%; animation-delay: 2.9s; background: var(--neon-pink); box-shadow: 4px 0 var(--neon-pink), -4px 0 var(--neon-pink), 0 4px var(--neon-pink), 0 -4px var(--neon-pink); }
.medal-sparkles i:nth-child(4) { left: 86%; top: 74%; animation-delay: 2.2s; background: var(--neon-yellow); box-shadow: 4px 0 var(--neon-yellow), -4px 0 var(--neon-yellow), 0 4px var(--neon-yellow), 0 -4px var(--neon-yellow); }
.medal-sparkles i:nth-child(5) { left: 50%; top: 2%;  animation-delay: 3.3s; }
.medal-sparkles i:nth-child(6) { left: 52%; top: 96%; animation-delay: 2.7s; background: var(--neon-yellow); box-shadow: 4px 0 var(--neon-yellow), -4px 0 var(--neon-yellow), 0 4px var(--neon-yellow), 0 -4px var(--neon-yellow); }
@keyframes vTwinkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50%      { opacity: 1; transform: scale(1.4); }
}

/* Mensagem */
.victory-message {
  max-width: 440px;
  padding: 0 6px;
  font-family: var(--font-pixel);
  font-size: clamp(11px, 3vw, 14px);
  line-height: 1.6;
  color: var(--tier-main);
  text-shadow: 0 0 10px var(--tier-glow);
  animation: vFadeUp 0.6s ease-out 1.9s both;
}

/* Painel de resultados */
.result-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 640px;
  padding: 10px;
  background: #110724;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 4px 0 #000, 0 0 18px rgba(157, 78, 221, 0.35);
  animation: vFadeUp 0.6s ease-out 2.1s both;
}
.result-cell {
  background: #070313;
  border: 1px solid rgba(157, 78, 221, 0.5);
  padding: 8px 4px;
  min-width: 0;
  animation: vFadeUp 0.4s ease-out both;
}
.result-cell:nth-child(1) { animation-delay: 2.25s; }
.result-cell:nth-child(2) { animation-delay: 2.35s; }
.result-cell:nth-child(3) { animation-delay: 2.45s; }
.result-cell:nth-child(4) { animation-delay: 2.55s; }
.result-cell:nth-child(5) { animation-delay: 2.65s; }
.result-label { font-family: var(--font-pixel); font-size: 9px; color: #94a3b8; letter-spacing: 0.5px; }
.result-value { font-family: var(--font-pixel); font-size: clamp(14px, 3.6vw, 18px); margin-top: 5px; overflow-wrap: anywhere; }

/* Botões */
.victory-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px; margin-top: 4px; width: 100%;
  animation: vFadeUp 0.5s ease-out 2.5s both;
}
.victory-btn-main { font-size: 13px !important; padding: 14px 28px !important; border-width: 3px; }
.victory-btn-sub  { font-size: 10px !important; padding: 10px 16px !important; opacity: 0.9; }
.victory-credit { font-family: var(--font-pixel); font-size: 9px; color: #a855f7; animation: vFadeUp 0.5s ease-out 2.7s both; }

@keyframes vFadeUp {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Celular */
@media (max-width: 560px) {
  .victory-stage { gap: 6px; }
  .victory-stage .end-sprite-box { width: 52px; height: 104px; }
  .victory-stage .character-plate { font-size: 7px; padding: 3px 6px; }
  .medal-wrap { width: clamp(110px, 38vw, 150px); }
  .result-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-cell:nth-child(1) { grid-column: 1 / -1; }
  .result-cell:nth-child(5) { grid-column: 1 / -1; }
  .victory-btn-main { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .victory-screen *, .victory-flash { animation: none !important; opacity: 1; }
  .victory-flash, .medal-sparkles { display: none; }
  .medal-rays { opacity: 0.4; }
}


/* Score final: sempre em uma única linha, centralizado, sem zeros à esquerda */
.result-cell { text-align: center; }
.result-score {
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.7);
}
