* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: white;
  background: #0b1020;
}

body.overlay {
  background: url('/assets/background.webp') center center / cover no-repeat;
}

.overlay {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
}

.card {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

h1 {
  margin: 0 0 18px;
  font-size: 42px;
  letter-spacing: 1px;
}

h2 {
  margin: 20px 0 8px;
}

.pokemon-box {
  height: 100vh;
  display: grid;
  place-items: center;
}

.silhouette {
  filter: brightness(0);
}

.answer {
  height: 44px;
  font-size: 32px;
  font-weight: 900;
}

.winner {
  min-height: 28px;
  font-size: 22px;
}

ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  margin: 6px 0;
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  font-size: 22px;
}

.page {
  max-width: 900px;
  margin: 40px auto;
  padding: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.08);
  border-radius: 18px;
  overflow: hidden;
}

th, td {
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  text-align: left;
}

#pokemon {
  width: 420px;
  height: 420px;
  object-fit: contain;
  image-rendering: auto;
  
  position: relative;
  z-index: 20;

  filter: brightness(0);
  transform: scale(1.6);

  transition:
    filter 0.8s ease,
    transform 0.8s ease,
    opacity 0.4s ease;
}

#pokemon.reveal {
  filter: brightness(1) drop-shadow(0 0 35px #fff);
  transform: scale(1.6);
  animation: revealFlash 1.2s ease;
}

#pokemon.pop {
  animation: pokemonReveal 1.4s cubic-bezier(.18,.89,.32,1.28);
}

@keyframes pokemonReveal {
  0% {
    transform: scale(1.6);
    filter: brightness(0);
  }

  15% {
    transform: scale(1.85);
    filter: brightness(0);
  }

  35% {
    transform: scale(1.95);
    filter: brightness(6)
            drop-shadow(0 0 15px #fff)
            drop-shadow(0 0 35px #fff);
  }

  60% {
    transform: scale(1.7);
    filter: brightness(1.4)
            drop-shadow(0 0 25px #fff);
  }

  100% {
    transform: scale(1.6);
    filter: brightness(1);
  }
}

body.reveal-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  animation: screenFlash 0.8s ease;
}

@keyframes screenFlash {
  0% { opacity: 0; }
  25% { opacity: 0.75; }
  100% { opacity: 0; }
}

.paused-message {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;

  flex-direction: column;
  justify-content: center;
  align-items: center;

  text-align: center;
  color: white;
  text-shadow: 0 5px 20px rgba(0,0,0,0.9);
  z-index: 9999;
}

.paused-title {
  font-size: 64px;
  font-weight: 900;
  margin-bottom: 24px;
}

.paused-text {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 14px;
}

.paused-subtitle {
  font-size: 30px;
  font-weight: 500;
}

@keyframes pausePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

.winner-banner {
  display: none;
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) scale(0.8);
  z-index: 10000;

  padding: 28px 48px;
  border-radius: 28px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  text-align: center;
  text-shadow: 0 4px 18px black;
  box-shadow: 0 0 45px rgba(255,255,255,0.45);
}

.winner-banner.show {
  display: block;
  animation: winnerPop 3s ease forwards;
}

.winner-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 2px;
}

.winner-name {
  font-size: 58px;
  font-weight: 900;
  margin-top: 8px;
}

.winner-points {
  font-size: 34px;
  font-weight: 800;
  margin-top: 6px;
}

@keyframes winnerPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.5) translateY(-40px);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) scale(1.15) translateY(0);
  }
  25% {
    transform: translateX(-50%) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0.9) translateY(-20px);
  }
}

#particleCanvas {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100vh;

  pointer-events: none;

  z-index: 50;
}


/* Pokémon Shiny */
body.shiny-reveal::after {
  content: '';
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 20;
  background: conic-gradient(
    from 0deg,
    rgba(255, 225, 90, 0.15),
    rgba(104, 240, 255, 0.16),
    rgba(255, 126, 231, 0.14),
    rgba(255, 225, 90, 0.15)
  );
  animation: shinyBackdrop 1.4s ease-out forwards;
}

#pokemon.shiny {
  filter:
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 34px rgba(255, 218, 67, 0.95))
    drop-shadow(0 0 58px rgba(95, 237, 255, 0.72));
  animation: shinyPokemonReveal 1.35s cubic-bezier(.2,.9,.25,1) both;
}

.winner-banner:has(+ .card #pokemon.shiny),
body.shiny-reveal .winner-banner {
  border: 2px solid rgba(255, 225, 90, 0.9);
  background: linear-gradient(135deg, rgba(28, 18, 42, 0.88), rgba(96, 60, 0, 0.84));
  box-shadow:
    0 0 28px rgba(255, 232, 100, 0.85),
    0 0 70px rgba(92, 235, 255, 0.55);
}

@keyframes shinyPokemonReveal {
  0% { opacity: 0; transform: scale(0.35) rotate(-8deg); filter: brightness(4) blur(8px); }
  36% { opacity: 1; transform: scale(1.22) rotate(3deg); filter: brightness(2.2) blur(0); }
  62% { transform: scale(0.94) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes shinyBackdrop {
  0% { opacity: 0; transform: scale(.7) rotate(0); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.3) rotate(35deg); }
}
