/* CONFIGURAÇÕES GERAIS */

* {
  box-sizing: border-box;
}

/* CORREÇÃO DO ATRIBUTO HIDDEN */

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  background-color: #0b101b;
  background-image:
    linear-gradient(rgba(11, 16, 27, 0.65), rgba(11, 16, 27, 0.85)),
    url("../Gallery/Regigigas.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #edf3ff;
  font-family: "Rajdhani", sans-serif;
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-enter > header,
body.page-enter main,
body.page-enter footer {
  animation: conteudo-entrada 0.72s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.page-from-hero > header { animation-delay: 0.08s; }
body.page-from-hero #inicio { animation: conteudo-entrada 0.72s 0.16s both cubic-bezier(0.2, 0.8, 0.2, 1); }
body.page-from-hero #pokedex { animation: conteudo-entrada 0.72s 0.24s both cubic-bezier(0.2, 0.8, 0.2, 1); }

h1,
h2,
h3,
p {
  margin-top: 0;
}

main {
  flex: 1;
}

/* CABEÇALHO */

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 22px 15px;
  background-color: rgba(10, 15, 26, 0.92);
  border-bottom: 2px solid #668bd8;
}

header h1 {
  margin: 0;
  color: #f0c969;
  font-family: "Press Start 2P", monospace;
  font-size: 23px;
  text-align: center;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
}

nav a {
  position: relative;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #aebbd1;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s, transform 0.3s;
}

nav a:hover {
  color: #f0c969;
}

nav a::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 4px;
  left: 13px;
  height: 2px;
  background: #f0c969;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
}

nav a:focus-visible {
  outline: 2px solid #f0c969;
  outline-offset: 3px;
}

nav a.ativo { color: #f6dd8f; background-color: rgba(102, 139, 216, 0.18); border-color: rgba(240, 201, 105, 0.5); }
nav a.ativo::after { transform: scaleX(1); }

.botao-menu-mobile {
  display: none;
}

/* Sugestões não permanece marcada fora da própria página. */
nav a[href="sugestoes.html"]:not([aria-current="page"]):not(:hover):not(:focus-visible) {
  color: #aebbd1 !important;
  background-color: transparent !important;
  border-color: transparent !important;
}

nav a[href="sugestoes.html"].ativo:not([aria-current="page"]) {
  color: inherit !important;
  background-color: transparent !important;
  border-color: transparent !important;
}

nav a[href="sugestoes.html"].ativo:not([aria-current="page"])::after {
  transform: scaleX(0) !important;
}

@media (max-width: 700px) {
  header {
    gap: 12px;
    padding: 16px 12px;
  }

  header h1 {
    font-size: clamp(18px, 6vw, 23px);
  }

  .botao-menu-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid rgba(240, 201, 105, 0.6);
    border-radius: 8px;
    background: rgba(13, 20, 35, 0.9);
    color: #f6dd8f;
    font: 700 14px "Rajdhani", sans-serif;
    letter-spacing: 1px;
    cursor: pointer;
  }

  .botao-menu-mobile:focus-visible {
    outline: 2px solid #f0c969;
    outline-offset: 3px;
  }

  header nav {
    display: none;
    width: min(100%, 360px);
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(102, 139, 216, 0.55);
    border-radius: 10px;
    background: rgba(10, 15, 26, 0.98);
  }

  header.menu-mobile-aberto nav {
    display: flex;
  }

  header nav a {
    width: 100%;
    padding: 11px 13px;
    text-align: center;
  }

  header nav .seletor-idioma {
    align-self: center;
    margin-top: 5px;
  }
}

header h1 {
  position: relative;
  letter-spacing: 3px;
  text-shadow: 0 0 16px rgba(240, 201, 105, 0.24), 3px 3px 0 rgba(0, 0, 0, 0.35);
  animation: logo-pulsar 4s ease-in-out infinite;
}

header h1::after {
  content: "";
  display: block;
  width: 56%;
  height: 2px;
  margin: 9px auto 0;
  background: linear-gradient(90deg, transparent, #668bd8, transparent);
  opacity: 0.9;
}

@keyframes conteudo-entrada {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-pulsar {
  0%, 100% { text-shadow: 0 0 16px rgba(240, 201, 105, 0.24), 3px 3px 0 rgba(0, 0, 0, 0.35); }
  50% { text-shadow: 0 0 24px rgba(240, 201, 105, 0.42), 3px 3px 0 rgba(0, 0, 0, 0.35); }
}

/* INÍCIO */

#inicio {
  padding: 35px 20px 20px;
  text-align: center;
}

#inicio h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

#inicio p {
  color: #aebbd1;
}

/* POKÉDEX */

#pokedex {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* CAMPO DE BUSCA */

.area-busca {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 20px;
}

.area-busca label {
  color: #f0c969;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.area-busca input {
  width: 100%;
  padding: 14px;
  background-color: rgba(10, 15, 26, 0.92);
  color: #edf3ff;
  border: 1px solid #334664;
  border-radius: 5px;
  font-family: "Rajdhani", sans-serif;
  font-size: 17px;
  outline: none;
}

.area-busca input:focus {
  border-color: #668bd8;
}

.area-busca input::placeholder {
  color: #737d94;
}

/* FILTROS POR TIPO */

.filtros-tipo {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 25px;
}

.lista-tipos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.aviso-filtros {
  width: 100%;
  min-height: 20px;
  margin: 0;
  color: #e0b878;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.tipo-filtro {
  position: relative;
  min-height: 36px;
  padding: 7px 14px;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #ffffff;
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  opacity: 0.82;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    opacity 0.2s,
    filter 0.2s;
}

.tipo-filtro:hover {
  opacity: 1;
  filter: brightness(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.tipo-filtro:active {
  box-shadow: none;
  transform: translateY(0) scale(0.95);
}

.tipo-filtro:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* CORES DOS TIPOS */

.todos {
  background-color: #777d8b;
}

.fogo {
  background-color: #b95748;
}

.agua {
  background-color: #4d79b8;
}

.planta {
  background-color: #648c61;
}

.eletrico {
  background-color: #b99b37;
}

.veneno {
  background-color: #9860a8;
}

.terrestre {
  background-color: #dbaf7d;
}

.pedra {
  background-color: #534432;
}

.gelo {
  background-color: #aff0f5;
}

.voador {
  background-color: #aabdd6;
}

.lutador {
  background-color: #972626;
}

.fada {
  background-color: #f8a8ff;
}

.dragao {
  background-color: #3641aa;
}

.aço {
  background-color: #b3b3b3;
}

.fantasma {
  background-color: #6b19b8;
}

.inseto {
  background-color: #c2f06d;
}

.psiquico {
  background-color: #cc2b76;
}

.normal {
  background-color: #7a7a7a;
}

.sombrio {
  background-color: #23253d;
}

.tipo-filtro.ativo {
  opacity: 1;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #f0c969, 0 0 16px rgba(240, 201, 105, 0.6);
  transform: translateY(-1px);
}

/* selo de confirmação (fora do fluxo: o botão não muda de tamanho) */

.tipo-filtro.ativo::after {
  content: "✓";
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f0c969;
  color: #0a0f1a;
  font-size: 11px;
  font-weight: 700;
}

/* LISTA DE POKÉMON */

.lista-pokemon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.divisoria-geracao {
  grid-column: 1 / -1;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  color: #f0c969;
  border-bottom: 2px solid #668bd8;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  text-align: center;
}

/* CARDS DOS POKÉMON */

.card-pokemon {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background-color: rgba(32, 31, 48, 0.94);
  border: 1px solid #302d45;
  border-left: 3px solid #668bd8;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 0.28s, border-color 0.28s, box-shadow 0.28s, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-pokemon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.07) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.card-pokemon:hover {
  background-color: rgba(41, 40, 61, 0.97);
  border-color: rgba(102, 139, 216, 0.85);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), 0 0 18px rgba(102, 139, 216, 0.16);
  transform: translateY(-5px) scale(1.012);
}

.card-pokemon:hover::after {
  transform: translateX(120%);
}

.card-pokemon img {
  flex-shrink: 0;
  width: 75px;
  height: 75px;
  object-fit: contain;
  background-color: #191929;
  border: 1px solid #35314d;
  border-radius: 8px;
  image-rendering: pixelated;
  transition: transform 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
}

.card-pokemon:hover img {
  border-color: #668bd8;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.35));
  transform: scale(1.08) rotate(-2deg);
}

.info-pokemon {
  min-width: 0;
}

.card-pokemon .numero {
  margin-bottom: 2px;
  color: #858ba2;
  font-size: 13px;
  font-weight: 700;
}

.card-pokemon h3 {
  margin-bottom: 7px;
  color: #f0eef8;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

/* TIPOS NOS CARDS */

.tipos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tipos span {
  padding: 2px 7px;
  border-radius: 3px;
  color: white;
  font-size: 11px;
  font-weight: 700;
}

/* =================================
   FICHA DE DETALHES DO POKÉMON
================================= */

/* O JavaScript troca estas variáveis de acordo com o tipo do Pokémon
   (--cor-1 e --cor-2 em hexadecimal, --rgb-1 e --rgb-2 em "r, g, b") */

#detalhes-pokemon {
  --cor-1: #668bd8;
  --cor-2: #668bd8;
  --rgb-1: 100, 125, 171;
  --rgb-2: 100, 125, 171;

  position: relative;
  margin-top: 10px;
  padding: 25px;
  background-color: rgba(32, 31, 48, 0.96);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(var(--rgb-1), 0.2), transparent 55%),
    radial-gradient(circle at 92% 0%, rgba(var(--rgb-2), 0.14), transparent 50%);
  border: 1px solid #334664;
  border-radius: 8px;
  overflow: hidden;
}

/* faixa colorida no topo da ficha */

#detalhes-pokemon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cor-1), var(--cor-2));
}

/* BOTÃO VOLTAR */

/* A cor do botão vem do tipo primário do Pokémon (--cor-1) e o texto,
   branco ou escuro, é escolhido pelo JavaScript (--texto-1) para manter o contraste. */

#voltar-pokedex {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  margin-bottom: 25px;
  background-color: var(--cor-1, #668bd8);
  color: var(--texto-1, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-left: 4px solid rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  font-family: "Rajdhani", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 16px rgba(var(--rgb-1, 100, 125, 171), 0.35);
  transition:
    filter 0.3s,
    box-shadow 0.3s,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#voltar-pokedex:hover {
  filter: brightness(1.12);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.4),
    0 0 22px rgba(var(--rgb-1, 100, 125, 171), 0.6);
  transform: translateX(-4px);
}

#voltar-pokedex:active {
  transform: translateX(-2px) scale(0.97);
}

#voltar-pokedex:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Animação do botão VOLTAR: fundo escurece da direita para a esquerda, brilho e seta que balança */

#voltar-pokedex {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#voltar-pokedex::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.22);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#voltar-pokedex::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(160%) skewX(-20deg);
  pointer-events: none;
}

#voltar-pokedex:hover::before,
#voltar-pokedex:focus-visible::before {
  transform: scaleX(1);
}

#voltar-pokedex:hover::after,
#voltar-pokedex:focus-visible::after {
  animation: brilho-voltar 0.8s ease;
}

#voltar-pokedex .seta-voltar {
  display: inline-block;
}

#voltar-pokedex:hover .seta-voltar,
#voltar-pokedex:focus-visible .seta-voltar {
  animation: seta-voltar 0.9s ease-in-out infinite;
}

@keyframes brilho-voltar {
  to { transform: translateX(-380%) skewX(-20deg); }
}

@keyframes seta-voltar {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  #abrir-filtros::after,
  #abrir-filtros:hover #total-filtros,
  #voltar-pokedex::after,
  #voltar-pokedex .seta-voltar {
    animation: none !important;
  }
}

/* CABEÇALHO DA FICHA */

.cabecalho-detalhes {
  position: relative;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 24px;
  background: linear-gradient(
    135deg,
    rgba(var(--rgb-1), 0.24),
    rgba(10, 15, 26, 0.88) 55%,
    rgba(var(--rgb-2), 0.18)
  );
  border: 1px solid rgba(var(--rgb-1), 0.5);
  border-radius: 10px;
  transition:
    border-color 0.3s,
    box-shadow 0.4s;
}

.cabecalho-detalhes:hover {
  border-color: rgba(var(--rgb-1), 0.9);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(var(--rgb-1), 0.25);
}

/* PALCO DO SPRITE (brilho colorido + sombra no chão) */

.palco-sprite {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 280px;
  background: radial-gradient(
    circle,
    rgba(var(--rgb-1), 0.5) 0%,
    rgba(var(--rgb-2), 0.2) 48%,
    transparent 72%
  );
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* anel tracejado que aparece e gira ao passar o mouse */

.palco-sprite::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 2px dashed rgba(var(--rgb-1), 0.85);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
  animation: girar-anel 14s linear infinite paused;
}

.palco-sprite::after {
  content: "";
  position: absolute;
  bottom: 34px;
  width: 120px;
  height: 14px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.6), transparent 70%);
  animation: sombra-sprite 3.2s ease-in-out infinite;
}

.palco-sprite:hover {
  transform: scale(1.06);
}

.palco-sprite:hover::before {
  opacity: 0.7;
  animation-play-state: running;
}

.palco-sprite img {
  position: relative;
  z-index: 1;
  width: 240px;
  height: 240px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
  transition: filter 0.4s;
  animation: flutuar-sprite 3.2s ease-in-out infinite;
}

.palco-sprite:hover img {
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 18px rgba(var(--rgb-1), 0.7)) brightness(1.07);
}

/* Alguns GIFs ocupam mais espaço visual dentro do mesmo quadro 256x256. */
.palco-sprite img.sprite-grande {
  width: 202px;
  height: 202px;
}

/* Todos os GIFs ficam dentro do anel; os casos maiores recebem o limite abaixo. */
.palco-sprite img.sprite-animado {
  width: 210px;
  height: 210px;
}

.palco-sprite img.sprite-animado.sprite-grande {
  width: 190px;
  height: 190px;
}

/* TÍTULO DA FICHA */

.titulo-detalhes {
  min-width: 0;
}

#numero-pokemon {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 14px;
  background-color: rgba(var(--rgb-1), 0.28);
  border: 1px solid rgba(var(--rgb-1), 0.7);
  border-radius: 20px;
  color: #f0eef8;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  transition:
    background-color 0.3s,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s;
}

#numero-pokemon:hover {
  background-color: rgba(var(--rgb-1), 0.5);
  box-shadow: 0 0 14px rgba(var(--rgb-1), 0.6);
  transform: scale(1.08);
}

.titulo-detalhes h2 {
  margin-bottom: 14px;
  color: #f4f1ea;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(var(--rgb-1), 0.7);
  overflow-wrap: anywhere;
  transition:
    text-shadow 0.4s,
    letter-spacing 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#formas-pokemon { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.linha-formas { display: flex; flex-direction: column; gap: 6px; }
.rotulo-formas { display: block; color: #f0c969; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.seletor-formas { display: flex; flex-wrap: wrap; gap: 6px; }
.seletor-formas button { min-height: 34px; padding: 6px 12px; border: 1px solid #3a4c6c; border-radius: 999px; background: rgba(10, 15, 26, 0.7); color: #c0c4d0; font: 600 13px "Rajdhani", sans-serif; cursor: pointer; transition: color .25s, background .25s, border-color .25s, transform .25s; }
.seletor-formas button:hover, .seletor-formas button.ativo { border-color: #f0c969; background: rgba(240, 201, 105, 0.2); color: #f6dd8f; transform: translateY(-2px); }
.seletor-formas button:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.nota-forma { margin: 0; padding: 8px 12px; border-left: 3px solid var(--cor-1, #f0c969); border-radius: 0 6px 6px 0; background: rgba(var(--rgb-1, 185, 167, 125), 0.14); color: #edf3ff; font-size: 14px; font-weight: 600; }

.titulo-detalhes h2:hover {
  letter-spacing: 2px;
  text-shadow:
    0 0 14px rgba(var(--rgb-1), 0.9),
    0 0 34px rgba(var(--rgb-1), 0.7);
}

#geracao-pokemon {
  margin: 14px 0 0;
  color: #aebbd1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* TIPOS NA FICHA */

#tipo-pokemon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tipo-pokemon span {
  padding: 6px 16px;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s,
    filter 0.3s;
}

#tipo-pokemon span:hover {
  transform: translateY(-4px) scale(1.07);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.45),
    0 0 14px rgba(255, 255, 255, 0.25);
  filter: brightness(1.15);
}

/* DESCRIÇÃO */

#descricao-pokemon {
  position: relative;
  margin: 20px 0;
  padding: 18px 20px 18px 56px;
  background-color: rgba(10, 15, 26, 0.8);
  border-left: 3px solid var(--cor-1);
  border-radius: 0 8px 8px 0;
  color: #d3d6e0;
  font-size: 18px;
  line-height: 1.6;
  transition:
    background-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#descricao-pokemon::before {
  content: "“";
  position: absolute;
  top: 6px;
  left: 16px;
  color: var(--cor-1);
  font-family: "Press Start 2P", monospace;
  font-size: 30px;
  opacity: 0.75;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

#descricao-pokemon:hover {
  background-color: rgba(10, 15, 26, 0.95);
  box-shadow:
    inset 4px 0 0 var(--cor-1),
    0 6px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}

#descricao-pokemon:hover::before {
  opacity: 1;
  transform: scale(1.2);
}

/* INFORMAÇÕES BÁSICAS */

.informacoes-basicas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.informacoes-basicas p {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 14px 16px;
  overflow: hidden;
  background-color: rgba(10, 15, 26, 0.8);
  border: 1px solid #334664;
  border-bottom: 3px solid var(--cor-1);
  border-radius: 6px;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}

/* faixa de brilho que atravessa o quadro */

.informacoes-basicas p::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.14),
    transparent
  );
  transform: translateX(-130%) skewX(-18deg);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.informacoes-basicas p:hover {
  transform: translateY(-5px);
  background-color: rgba(var(--rgb-1), 0.16);
  border-color: rgba(var(--rgb-1), 0.6);
  box-shadow: 0 10px 22px rgba(var(--rgb-1), 0.35);
}

.informacoes-basicas p:hover::after {
  transform: translateX(260%) skewX(-18deg);
}

.informacoes-basicas small {
  color: #f0c969;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.informacoes-basicas span {
  color: #f0eef8;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  transition:
    color 0.3s,
    text-shadow 0.3s;
}

.informacoes-basicas p:hover span {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(var(--rgb-1), 0.9);
}

/* PAINÉIS: HABILIDADES, ATRIBUTOS E EVOLUÇÕES */

.habilidades-pokemon,
.atributos-pokemon,
.evolucoes-pokemon {
  margin-top: 20px;
  padding: 20px;
  background-color: rgba(10, 15, 26, 0.8);
  border: 1px solid #334664;
  border-radius: 8px;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background-color 0.3s;
}

.habilidades-pokemon:hover,
.atributos-pokemon:hover,
.evolucoes-pokemon:hover {
  background-color: rgba(10, 15, 26, 0.92);
  border-color: rgba(var(--rgb-1), 0.7);
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(var(--rgb-1), 0.25);
}

#detalhes-pokemon h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #f0c969;
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
}

/* losango colorido antes dos títulos */

#detalhes-pokemon h3::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  background-color: var(--cor-1);
  box-shadow: 0 0 8px var(--cor-1);
  transform: rotate(45deg);
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s;
}

/* o losango gira quando o mouse está sobre o painel */

#detalhes-pokemon .habilidades-pokemon:hover h3::before,
#detalhes-pokemon .atributos-pokemon:hover h3::before,
#detalhes-pokemon .evolucoes-pokemon:hover h3::before {
  transform: rotate(225deg) scale(1.25);
  box-shadow: 0 0 14px var(--cor-1);
}

/* HABILIDADES */

.lista-habilidades {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-habilidade {
  padding: 8px 18px;
  background-color: rgba(var(--rgb-1), 0.16);
  border: 1px solid rgba(var(--rgb-1), 0.6);
  border-radius: 999px;
  color: #f0eef8;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}

.chip-habilidade:hover {
  transform: translateY(-4px) scale(1.05);
  background-color: rgba(var(--rgb-1), 0.38);
  border-color: var(--cor-1);
  box-shadow: 0 8px 18px rgba(var(--rgb-1), 0.4);
}

.chip-habilidade.oculta {
  background-color: transparent;
  border: 1px dashed #f0c969;
  color: #f0c969;
}

.chip-habilidade.oculta:hover {
  background-color: rgba(240, 201, 105, 0.14);
  border-color: #f0d98c;
  box-shadow: 0 8px 18px rgba(240, 201, 105, 0.35);
}

.chip-habilidade small {
  margin-left: 8px;
  padding: 2px 7px;
  background-color: #f0c969;
  border-radius: 4px;
  color: #0b101b;
  font-size: 11px;
  letter-spacing: 1.5px;
}

/* ATRIBUTOS (BARRAS) */

#stats-pokemon {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.linha-stat {
  display: grid;
  grid-template-columns: 150px 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.linha-stat:hover {
  background-color: rgba(var(--rgb-1), 0.14);
}

.nome-stat {
  color: #aebbd1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.valor-stat {
  color: #f0eef8;
  font-size: 19px;
  font-weight: 700;
  text-align: right;
  transition:
    color 0.3s,
    text-shadow 0.3s;
}

.linha-stat:hover .nome-stat {
  color: #edf3ff;
}

.linha-stat:hover .valor-stat {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(var(--rgb-1), 0.9);
}

.trilho-stat {
  height: 12px;
  background-color: #0a0f1a;
  border: 1px solid #302d45;
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.linha-stat:hover .trilho-stat {
  border-color: rgba(var(--rgb-1), 0.7);
}

.barra-stat {
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition:
    width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.3s;
}

.linha-stat:hover .barra-stat {
  filter: brightness(1.25) saturate(1.1);
}

.barra-stat.nivel-1 {
  background: linear-gradient(90deg, #8f3f33, #d9654f);
  box-shadow: 0 0 8px rgba(217, 101, 79, 0.6);
}

.barra-stat.nivel-2 {
  background: linear-gradient(90deg, #a77a2d, #e0b93a);
  box-shadow: 0 0 8px rgba(224, 185, 58, 0.5);
}

.barra-stat.nivel-3 {
  background: linear-gradient(90deg, #4f7a4c, #6fae6a);
  box-shadow: 0 0 8px rgba(111, 174, 106, 0.5);
}

.barra-stat.nivel-4 {
  background: linear-gradient(90deg, #3e63a1, #5b8fd6);
  box-shadow: 0 0 8px rgba(91, 143, 214, 0.6);
}

.barra-stat.nivel-5 {
  background: linear-gradient(90deg, #f0c969, #f0d98c);
  box-shadow: 0 0 10px rgba(240, 217, 140, 0.7);
}

.linha-stat.total {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed #334664;
}

.linha-stat.total .nome-stat,
.linha-stat.total .valor-stat {
  color: #f0c969;
}

.nota-total {
  color: #737d94;
  font-size: 14px;
}

/* EVOLUÇÕES */

.cadeia-evolutiva {
  padding: 10px 4px 14px;
  overflow-x: auto;
}

.grupo-evolucao {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0 auto;
}

.ramificacoes-evolucao {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ramo-evolucao {
  display: flex;
  align-items: center;
}

/* conector: condição em cima, setinha embaixo */

.conector-evolucao {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  width: 150px;
  padding: 0 10px;
  text-align: center;
}

.condicao-evolucao {
  margin: 0;
  color: #d9c796;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: pre-line;
  transition: color 0.3s;
}

.conector-evolucao:hover .condicao-evolucao {
  color: #ffffff;
}

.ou-evolucao {
  margin: 0;
  color: #737d94;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.seta-evolucao {
  position: relative;
  display: block;
  width: 62px;
  height: 2px;
  background: linear-gradient(90deg, #668bd8, #f0c969);
  animation: pulsar-seta 2s ease-in-out infinite;
}

.seta-evolucao::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #f0c969;
}

/* card de cada Pokémon da cadeia */

.card-evolucao {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 128px;
  padding: 14px 10px 12px;
  background:
    radial-gradient(circle at 50% 22%, rgba(var(--rgb-1), 0.28), transparent 65%),
    #201f30;
  border: 1px solid #334664;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.3s,
    box-shadow 0.3s;
}

.card-evolucao img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  image-rendering: pixelated;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.35s;
}

.card-evolucao p {
  margin: 0;
  color: #858ba2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.card-evolucao h4 {
  margin: 0 0 4px;
  color: #f4f1ea;
  font-size: 19px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
  transition: text-shadow 0.3s;
}

.card-evolucao .tipos {
  justify-content: center;
}

.card-evolucao .tipos span {
  padding: 2px 6px;
  font-size: 10px;
}

.card-evolucao:hover {
  transform: translateY(-8px);
  border-color: var(--cor-1);
  box-shadow:
    0 12px 24px rgba(var(--rgb-1), 0.45),
    0 0 18px rgba(var(--rgb-1), 0.3);
}

.card-evolucao:hover img {
  transform: scale(1.18) translateY(-3px);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 12px rgba(var(--rgb-1), 0.7));
}

.card-evolucao:hover p {
  color: #d3d6e0;
}

.card-evolucao:hover h4 {
  text-shadow: 0 0 12px rgba(var(--rgb-1), 0.9);
}

.card-evolucao:active {
  transform: translateY(-2px) scale(0.97);
}

/* Pokémon que está sendo visto agora */

.card-evolucao.evolucao-atual {
  border-color: #f0c969;
  box-shadow: 0 0 14px rgba(240, 201, 105, 0.45);
}

.card-evolucao.evolucao-atual::before {
  content: attr(data-rotulo-atual);
  position: absolute;
  top: -9px;
  padding: 2px 8px;
  background-color: #f0c969;
  border-radius: 4px;
  color: #0b101b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.sem-evolucao {
  margin: 0;
  color: #aebbd1;
  font-size: 17px;
}

/* ANIMAÇÕES DA FICHA */

@keyframes flutuar-sprite {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes sombra-sprite {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.45;
  }
}

@keyframes girar-anel {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes surgir {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulsar-seta {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* o JavaScript adiciona a classe "animar" toda vez que uma ficha abre
   ("backwards" faz a animação não prender o elemento depois que termina,
   assim os efeitos de passar o mouse continuam funcionando) */

#detalhes-pokemon.animar > * {
  animation: surgir 0.55s ease backwards;
}

#detalhes-pokemon.animar > :nth-child(2) {
  animation-delay: 0.05s;
}

#detalhes-pokemon.animar > :nth-child(3) {
  animation-delay: 0.12s;
}

#detalhes-pokemon.animar > :nth-child(4) {
  animation-delay: 0.18s;
}

#detalhes-pokemon.animar > :nth-child(5) {
  animation-delay: 0.24s;
}

#detalhes-pokemon.animar > :nth-child(6) {
  animation-delay: 0.3s;
}

#detalhes-pokemon.animar > :nth-child(7) {
  animation-delay: 0.36s;
}

/* quem prefere menos movimento no sistema não vê as animações */

@media (prefers-reduced-motion: reduce) {
  #detalhes-pokemon *,
  #detalhes-pokemon *::before,
  #detalhes-pokemon *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* MELHORIAS DE BUSCA, ESTADOS E NAVEGACAO */
.campo-busca { position: relative; display: flex; align-items: center; }
.campo-busca input { padding-right: 44px; padding-left: 42px; }
.campo-busca input::-webkit-search-cancel-button,
.campo-busca input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.campo-busca input::-ms-clear { display: none; width: 0; height: 0; }
.icone-busca { position: absolute; left: 15px; z-index: 1; color: #f0c969; font-size: 26px; line-height: 1; pointer-events: none; transform: rotate(-20deg); }
#limpar-busca { position: absolute; right: 10px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #aebbd1; font-size: 24px; line-height: 1; cursor: pointer; transition: color 0.2s, background 0.2s; }
#limpar-busca:hover, #limpar-busca:focus-visible { background: rgba(102, 139, 216, 0.22); color: #f6dd8f; }
.status-carregamento, .estado-vazio { margin: 30px auto; padding: 24px; max-width: 520px; border: 1px solid #334664; border-radius: 9px; background: rgba(10, 15, 26, 0.82); color: #f0c969; text-align: center; }
.status-carregamento span { display: inline-block; width: 24px; overflow: hidden; vertical-align: bottom; animation: pontos-carregamento 1.2s steps(4, end) infinite; }
.status-carregamento.erro-carregamento { color: #e8a294; }
.estado-vazio { color: #edf3ff; }
.estado-vazio small { display: block; margin-top: 8px; color: #aebbd1; font-size: 15px; }
.lista-pokemon.atualizando .card-pokemon:not([style*="display: none"]) { animation: card-filtro 0.32s both; }
.card-pokemon:focus-visible { outline: 2px solid #f0c969; outline-offset: 3px; }
#voltar-topo { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #668bd8; border-radius: 50%; background: rgba(10, 15, 26, 0.9); color: #f6dd8f; font-size: 24px; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s; }
#voltar-topo.visivel { opacity: 1; visibility: visible; transform: translateY(0); }
#voltar-topo:hover, #voltar-topo:focus-visible { background: #668bd8; color: #fff; transform: translateY(-3px); }
#voltar-jogos, #voltar-pokedex-comum { display: block; width: fit-content; margin: 24px auto 0; padding: 10px 18px; border: 1px solid #668bd8; border-radius: 999px; background: rgba(10, 15, 26, 0.9); color: #f6dd8f; font-weight: 700; letter-spacing: 0.8px; text-decoration: none; transition: background 0.25s, border-color 0.25s, transform 0.25s; }
#voltar-jogos:hover, #voltar-jogos:focus-visible, #voltar-pokedex-comum:hover, #voltar-pokedex-comum:focus-visible { background: rgba(102, 139, 216, 0.28); border-color: #f0c969; transform: translateY(-2px); }
#voltar-jogos:focus-visible, #voltar-pokedex-comum:focus-visible { outline: 2px solid #f0c969; outline-offset: 3px; }
@keyframes pontos-carregamento { from { width: 0; } to { width: 24px; } }
@keyframes card-filtro { from { opacity: 0.25; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
  #pokedex { padding: 14px; }
  header { gap: 10px; padding: 17px 12px; }
  nav { width: 100%; gap: 5px; }
  nav a { flex: 1; padding: 9px 5px; font-size: 12px; text-align: center; }
  .lista-pokemon { grid-template-columns: 1fr; gap: 10px; }
  .card-pokemon { padding: 10px; }
  #voltar-topo { right: 14px; bottom: 14px; }
}

/* Correção final da cadeia do Rockruff/Lycanroc. */
.grupo-lycanroc {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  width: 100% !important;
}

.grupo-lycanroc > .card-evolucao {
  display: flex;
  grid-area: auto;
}

.grupo-lycanroc > .ramificacoes-evolucao {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  grid-template-areas:
    "esquerda vazio direita"
    "vazio2 baixo vazio3";
  width: 100%;
  margin-top: 12px;
  gap: 14px;
}

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-self: center;
  width: 100%;
}

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(1) { grid-area: esquerda; }
.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(2) { grid-area: direita; }
.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(3) { grid-area: baixo; }

@media (max-width: 700px) {
  .grupo-lycanroc > .ramificacoes-evolucao {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

/* Cadeias com ramificações: Pokémon-base centralizado e evoluções distribuídas. */
.grupo-lycanroc,
.grupo-eevee {
  display: grid;
  align-items: center;
  justify-content: center;
  width: min(100%, 860px);
  margin: 0 auto;
}

.grupo-lycanroc {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  grid-template-areas:
    "esquerda centro direita"
    "vazio baixo vazio";
  row-gap: 12px;
}

.grupo-lycanroc > .card-evolucao {
  grid-area: centro;
  justify-self: center;
}

.grupo-lycanroc > .ramificacoes-evolucao,
.grupo-eevee > .ramificacoes-evolucao {
  display: contents;
}

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(1) { grid-area: esquerda; }
.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(2) { grid-area: direita; }
.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(3) { grid-area: baixo; }

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao,
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao {
  justify-self: center;
}

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao:nth-child(3) {
  flex-direction: column;
}

.grupo-eevee {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  grid-template-areas:
    "centro centro centro centro"
    "e1 e2 e3 e4"
    "e5 e6 e7 e8";
  row-gap: 14px;
}

.grupo-eevee > .card-evolucao { grid-area: centro; justify-self: center; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(1) { grid-area: e1; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(2) { grid-area: e2; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(3) { grid-area: e3; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(4) { grid-area: e4; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(5) { grid-area: e5; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(6) { grid-area: e6; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(7) { grid-area: e7; }
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao:nth-child(8) { grid-area: e8; }

/* Ajuste das ramificações: cada ramo ocupa sua célula sem criar um segundo grid. */
.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao,
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.grupo-lycanroc > .ramificacoes-evolucao > .ramo-evolucao > .grupo-evolucao,
.grupo-eevee > .ramificacoes-evolucao > .ramo-evolucao > .grupo-evolucao {
  display: contents;
}

.grupo-lycanroc .conector-evolucao,
.grupo-eevee .conector-evolucao {
  width: auto;
  min-width: 110px;
  padding: 0 8px 8px;
}

.grupo-lycanroc .seta-evolucao,
.grupo-eevee .seta-evolucao {
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, #668bd8, #f0c969);
}

.grupo-lycanroc .seta-evolucao::after,
.grupo-eevee .seta-evolucao::after {
  top: auto;
  right: auto;
  bottom: -2px;
  left: -5px;
  border-top: 10px solid #f0c969;
  border-right: 6px solid transparent;
  border-bottom: 0;
  border-left: 6px solid transparent;
}

@media (max-width: 700px) {
  .grupo-lycanroc,
  .grupo-eevee {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .grupo-lycanroc > .ramificacoes-evolucao,
  .grupo-eevee > .ramificacoes-evolucao {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
}

/* FICHA EM TELAS MÉDIAS */

@media (max-width: 900px) {
  .informacoes-basicas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* FICHA NO CELULAR */

@media (max-width: 700px) {
  #detalhes-pokemon {
    padding: 14px;
  }

  .cabecalho-detalhes {
    flex-direction: column;
    gap: 10px;
    padding: 18px 14px;
    text-align: center;
  }

  .palco-sprite {
    width: 230px;
    height: 230px;
  }

  .palco-sprite img {
    width: 192px;
    height: 192px;
  }

  .palco-sprite img.sprite-grande {
    width: 162px;
    height: 162px;
  }

  .palco-sprite img.sprite-animado {
    width: 176px;
    height: 176px;
  }

  .palco-sprite img.sprite-animado.sprite-grande {
    width: 158px;
    height: 158px;
  }

  .titulo-detalhes h2 {
    font-size: 34px;
  }

  #tipo-pokemon {
    justify-content: center;
  }

  .linha-stat {
    grid-template-columns: 105px 38px minmax(0, 1fr);
    gap: 8px;
  }

  .nome-stat {
    font-size: 14px;
  }

  /* cadeia evolutiva vira uma coluna, com a seta para baixo */

  .grupo-evolucao,
  .ramo-evolucao {
    flex-direction: column;
  }

  .ramificacoes-evolucao {
    align-items: center;
  }

  .conector-evolucao {
    width: auto;
    max-width: 220px;
    padding: 10px 0;
  }

  .seta-evolucao {
    width: 2px;
    height: 34px;
    background: linear-gradient(180deg, #668bd8, #f0c969);
  }

  .seta-evolucao::after {
    top: auto;
    right: auto;
    bottom: -2px;
    left: -5px;
    border-top: 10px solid #f0c969;
    border-right: 6px solid transparent;
    border-bottom: 0;
    border-left: 6px solid transparent;
  }
}

/* RODAPÉ */

footer {
  margin-top: 40px;
  padding: 20px;
  background-color: rgba(10, 15, 26, 0.94);
  border-top: 1px solid #334664;
  color: #aebbd1;
  text-align: center;
  font-size: 13px;
}

/* =================================
   TABLETS
================================= */

@media (min-width: 551px) and (max-width: 900px) {
  .lista-pokemon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =================================
   CELULARES
================================= */

@media (max-width: 550px) {

  body {
    background-size: auto 100vh;
    background-position: center top;
    background-attachment: scroll;
    background-repeat: repeat-y;
  }

  header {
    padding: 20px 10px;
  }

  header h1 {
    font-size: 19px;
  }

  nav {
    gap: 15px;
  }

  nav a {
    font-size: 12px;
  }

  #inicio {
    padding-top: 25px;
  }

  #inicio h2 {
    font-size: 25px;
  }

  #pokedex {
    padding: 12px;
  }

  .lista-pokemon {
    grid-template-columns: 1fr;
  }

  .card-pokemon img {
    width: 65px;
    height: 65px;
  }

  .filtros-tipo {
    gap: 5px;
  }

  .tipo-filtro {
    padding: 5px 8px;
  }

}

@media (prefers-reduced-motion: reduce) {
  body.page-enter > header,
  body.page-enter main,
  body.page-enter footer,
  body.page-from-hero #inicio,
  body.page-from-hero #pokedex,
  header h1,
  .card-pokemon,
  .card-pokemon img,
  .card-pokemon::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =================================
   AJUSTES DE COR E CONTRASTE DOS TIPOS
================================= */

.agua { background-color: #4770ab; }
.normal { background-color: #717171; }

/* texto escuro nos tipos de fundo claro (botões, cards e evoluções) */

.tipo-filtro:is(.gelo, .inseto, .fada, .voador, .terrestre, .aço, .eletrico, .todos),
.tipos span:is(.gelo, .inseto, .fada, .voador, .terrestre, .aço, .eletrico) {
  color: #0a0f1a;
}

/* =================================
   BARRA DE GERAÇÕES
================================= */

.filtros-geracao {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 18px;
}

.filtro-geracao {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #3a4c6c;
  border-radius: 999px;
  background: rgba(10, 15, 26, 0.85);
  color: #c0c4d0;
  font: 700 13px "Rajdhani", sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}

.filtro-geracao small {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.filtro-geracao:hover {
  border-color: #f0c969;
  color: #f6dd8f;
  transform: translateY(-2px);
}

.filtro-geracao:active {
  transform: scale(0.96);
}

.filtro-geracao:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.filtro-geracao.ativo {
  border-color: #f0c969;
  background: #f0c969;
  color: #0a0f1a;
}

.filtro-geracao.ativo small {
  background: rgba(0, 0, 0, 0.18);
}

/* =================================
   POKÉMON SHINY
================================= */

.selo-shiny {
  position: absolute;
  top: 6px;
  right: 0;
  z-index: 3;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e27a, #d9a82c);
  color: #0a0f1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 0 14px rgba(246, 226, 122, 0.8);
  animation: brilho-shiny 1.8s ease-in-out infinite;
}

.palco-sprite.shiny {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(246, 226, 122, 0.6), 0 0 30px rgba(246, 226, 122, 0.45);
}

#detalhes-pokemon.e-shiny {
  border-color: #e5c85a;
}

.card-shiny {
  border-left-color: #f6e27a;
  box-shadow: 0 0 14px rgba(246, 226, 122, 0.35);
}

.selo-shiny-card {
  position: absolute;
  top: 6px;
  right: 8px;
  color: #f6e27a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

@keyframes brilho-shiny {
  50% { box-shadow: 0 0 24px rgba(246, 226, 122, 1); }
}

@media (prefers-reduced-motion: reduce) {
  .selo-shiny { animation: none; }
}

/* BOTÃO DE LUZINHA (alterna o sprite shiny) */

.botao-shiny {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(10, 15, 26, 0.7);
  color: rgba(255, 255, 255, 0.55);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.25s,
    color 0.25s,
    border-color 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}

.botao-shiny:hover {
  transform: scale(1.1);
  color: #f6e27a;
  border-color: #f6e27a;
  box-shadow: 0 0 14px rgba(246, 226, 122, 0.55);
}

.botao-shiny:focus-visible {
  outline: 2px solid #f6e27a;
  outline-offset: 3px;
}

.botao-shiny.ativo {
  color: #0a0f1a;
  border-color: #f6e27a;
  background: linear-gradient(135deg, #f6e27a, #d9a82c);
  box-shadow: 0 0 18px rgba(246, 226, 122, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .botao-shiny { transition: none; }
}

/* =================================
   EEVEE: CÍRCULO DE EVOLUÇÕES
================================= */

.circulo-eevee {
  position: relative;
  width: min(100%, 680px);
  aspect-ratio: 1;
  margin: 40px auto;
}

.setas-eevee {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.setas-eevee line {
  stroke: #f0c969;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.no-eevee {
  position: absolute;
  width: 19%;
  transform: translate(-50%, -50%);
}

.no-eevee.centro {
  width: 22%;
}

.circulo-eevee .card-evolucao {
  width: 100%;
  padding: 8px 6px;
}

.circulo-eevee .card-evolucao > p:not(.legenda-eevee) {
  display: none;
}

.circulo-eevee .card-evolucao img {
  width: 62%;
  height: auto;
  aspect-ratio: 1;
}

.legenda-eevee {
  margin: 0;
  color: #aebbd1;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
}

@media (max-width: 700px) {
  .circulo-eevee {
    margin: 30px auto;
  }

  .no-eevee {
    width: 21%;
  }

  .no-eevee.centro {
    width: 24%;
  }

  .circulo-eevee .card-evolucao {
    padding: 6px 3px;
  }

  .circulo-eevee .card-evolucao img {
    width: 74%;
  }

  .circulo-eevee .card-evolucao h4 {
    font-size: 10px;
  }

  .circulo-eevee .card-evolucao .tipos,
  .legenda-eevee {
    display: none;
  }
}

/* =================================
   ÁREA DO USUÁRIO NO MENU
================================= */

.area-usuario {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.area-usuario .ola-usuario {
  color: #f0c969;
  font-size: 14px;
  font-weight: 700;
}

.area-usuario button {
  padding: 4px 10px;
  border: 1px solid #668bd8;
  border-radius: 4px;
  background: none;
  color: #aebbd1;
  font: 700 13px "Rajdhani", sans-serif;
  cursor: pointer;
}

.area-usuario button:hover {
  color: #f0c969;
}

/* =================================
   SPRITES 2D RECORTADOS
================================= */

.palco-sprite img.sprite-animado.sprite-recortado {
  width: min(210px, calc(var(--largura-sprite, 80px) * 2.2));
  height: min(210px, calc(var(--altura-sprite, 80px) * 2.2));
}

.card-evolucao img.sprite-recortado {
  object-fit: scale-down;
}

/* =================================
   CÍRCULO COMPACTO (2 a 4 evoluções)
================================= */

.circulo-eevee.compacto {
  width: min(100%, 500px);
  margin: 10px auto;
}

/* com duas evoluções tudo fica na mesma linha: corta o espaço vazio */
.circulo-eevee.dupla {
  margin-block: -90px;
}

.circulo-eevee.compacto .no-eevee {
  width: 25%;
}

.circulo-eevee.compacto .card-evolucao .tipos {
  display: none;
}

@media (max-width: 700px) {
  .circulo-eevee.compacto .no-eevee {
    width: 28%;
  }

  .circulo-eevee.compacto .legenda-eevee {
    display: block;
    font-size: 9px;
  }

  .circulo-eevee.dupla {
    margin-block: -50px;
  }
}

/* círculo no meio de uma cadeia (ex.: Oddish -> Gloom -> evoluções) */

.ramo-evolucao > .circulo-eevee.compacto {
  flex-shrink: 0;
  width: 500px;
}

@media (max-width: 700px) {
  .circulo-eevee.compacto .card-evolucao img {
    width: 54%;
  }

  .circulo-eevee.compacto .card-evolucao h4 {
    font-size: 9px;
    overflow-wrap: anywhere;
  }

  .circulo-eevee.compacto .legenda-eevee {
    font-size: 8px;
    letter-spacing: 0;
  }

  .grupo-evolucao:has(.circulo-eevee),
  .ramo-evolucao:has(.circulo-eevee) {
    flex-direction: column;
    width: 100%;
  }

  .ramo-evolucao:has(> .circulo-eevee) > .conector-evolucao .seta-evolucao {
    margin: 22px 0;
    transform: rotate(90deg);
  }

  .ramo-evolucao > .circulo-eevee.compacto {
    width: 100%;
  }
}

/* =================================
   BOTÃO E PAINEL CIRCULAR DE FILTROS
================================= */

#abrir-filtros {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 28px;
  border: 1px solid #f0c969;
  border-radius: 999px;
  background: rgba(10, 15, 26, 0.92);
  color: #f6dd8f;
  font: 700 15px "Rajdhani", sans-serif;
  letter-spacing: 2px;
  cursor: pointer;
}

/* Animação do botão FILTROS: preenchimento dourado, pokébola girando e brilho */

#abrir-filtros {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(#f0c969, #f0c969) no-repeat left center / 0% 100%,
    rgba(10, 15, 26, 0.92);
  transition:
    background-size 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.3s 0.08s,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s;
}

/* mini pokébola antes do texto */

#abrir-filtros::before {
  content: "";
  order: -1;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(#db5964 0 42%, #0a0f1a 42% 58%, #e8edf7 58%);
  transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.4, 1);
}

/* faixa de brilho que atravessa o botão */

#abrir-filtros::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-160%) skewX(-20deg);
  pointer-events: none;
}

#abrir-filtros:hover,
#abrir-filtros:focus-visible {
  background-size: 100% 100%, auto;
  color: #0a0f1a;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.4),
    0 0 22px rgba(240, 201, 105, 0.45);
  transform: translateY(-3px);
}

#abrir-filtros:hover::before,
#abrir-filtros:focus-visible::before {
  transform: rotate(360deg) scale(1.15);
}

#abrir-filtros:hover::after,
#abrir-filtros:focus-visible::after {
  animation: brilho-filtros 0.8s 0.1s ease;
}

#abrir-filtros:hover #total-filtros {
  animation: pulso-filtros 0.6s 0.2s ease;
}

#abrir-filtros:active {
  transform: translateY(0) scale(0.97);
}

@keyframes brilho-filtros {
  to { transform: translateX(380%) skewX(-20deg); }
}

@keyframes pulso-filtros {
  50% { transform: scale(1.3); }
}

#total-filtros {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #668bd8;
  color: #ffffff;
  font-size: 13px;
}

html:has(#painel-filtros[open]) {
  overflow: hidden;
}

#painel-filtros {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 8px;
  border: 0;
  background: rgba(10, 11, 17, 0.94);
  color: #edf3ff;
  overflow: auto;
}

#painel-filtros[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
}

#painel-filtros .palco-filtros {
  position: relative;
  flex-shrink: 0;
  width: min(100%, 720px);
  height: clamp(520px, calc(100dvh - 70px), 720px);
}

#painel-filtros .lista-tipos,
#painel-filtros .filtros-geracao {
  display: contents;
}

#painel-filtros .tipo-filtro,
#painel-filtros .filtro-geracao {
  position: absolute;
  left: calc(50% + var(--cos, 0) * var(--raio-x));
  top: calc(50% + var(--sen, 0) * var(--raio-y));
  translate: -50% -50%;
  white-space: nowrap;
}

#painel-filtros[open] .tipo-filtro,
#painel-filtros[open] .filtro-geracao {
  animation: surgir-filtro 0.35s calc(var(--ordem, 0) * 0.015s) backwards;
}

/* círculo de fora: tipos */

#painel-filtros .tipo-filtro {
  --raio-x: 43%;
  --raio-y: 45%;
  width: 92px;
  padding-inline: 4px;
}

/* círculo de dentro: gerações */

#painel-filtros .filtro-geracao {
  --raio-x: 24%;
  --raio-y: 25%;
  width: 82px;
  padding-inline: 4px;
}

.centro-filtros {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  translate: -50% -50%;
}

#fechar-filtros {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border: 3px solid #f0c969;
  border-radius: 50%;
  background: #201f30;
  color: #f6dd8f;
  font: 700 12px "Rajdhani", sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(240, 201, 105, 0.4);
}

#fechar-filtros strong {
  font-size: 30px;
  line-height: 1;
}

#limpar-filtros {
  position: absolute;
  top: calc(100% + 6px);
  padding: 4px 12px;
  border: 0;
  background: none;
  color: #c0c4d0;
  font: 700 13px "Rajdhani", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

@keyframes surgir-filtro {
  from { left: 50%; top: 50%; opacity: 0; }
}

@media (max-width: 600px) {
  #painel-filtros .tipo-filtro {
    --raio-x: 40.5%;
    --raio-y: 46%;
    width: 62px;
    font-size: 10px;
    letter-spacing: 0;
  }

  #painel-filtros .filtro-geracao {
    --raio-x: 22%;
    --raio-y: 26%;
    width: 40px;
    min-height: 34px;
    padding: 2px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: normal;
  }

  #painel-filtros .filtro-geracao small {
    display: none;
  }

  #fechar-filtros {
    width: 84px;
    height: 84px;
    font-size: 9px;
  }

  #fechar-filtros strong {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #painel-filtros[open] .tipo-filtro,
  #painel-filtros[open] .filtro-geracao {
    animation: none;
  }
}

@media (max-width: 600px) {
  #painel-filtros .palco-filtros {
    height: clamp(640px, calc(100dvh - 70px), 720px);
  }
}

/* largura suficiente para os textos mais longos */

#painel-filtros .tipo-filtro {
  width: 102px;
}

#painel-filtros .filtro-geracao {
  width: 104px;
}

@media (max-width: 600px) {
  #painel-filtros .tipo-filtro {
    width: 62px;
    padding-inline: 1px;
    font-size: 9px;
  }

  #painel-filtros .filtro-geracao {
    width: 40px;
  }
}

@media (min-width: 601px) {
  #painel-filtros .filtro-geracao {
    --raio-x: 25%;
    width: 98px;
  }

  #painel-filtros .filtro-geracao small {
    margin-left: 3px;
    padding-inline: 5px;
  }
}

/* =================================
   BARRA FLUTUANTE DA FICHA
================================= */

/* "clip" mantém o recorte sem impedir a barra de acompanhar a rolagem */
#detalhes-pokemon {
  overflow: clip;
}

.navegacao-ficha {
  position: sticky;
  top: 8px;
  z-index: 15;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: auto;
  margin: 0 0 20px;
  padding: 8px;
  border: 1px solid #334664;
  border-radius: 10px;
  background: rgba(10, 15, 26, 0.92);
}

.navegacao-ficha #voltar-pokedex {
  margin: 0;
}

.vizinhos {
  display: flex;
  gap: 8px;
}

.botao-vizinho {
  position: relative;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #3a4c6c;
  border-radius: 6px;
  background: #201f30;
  color: #edf3ff;
  font: 700 14px "Rajdhani", sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.botao-vizinho:hover:not(:disabled),
.botao-vizinho:focus-visible {
  border-color: var(--cor-1, #f0c969);
  background: rgba(var(--rgb-1, 185, 167, 125), 0.3);
  box-shadow: 0 0 16px rgba(var(--rgb-1, 185, 167, 125), 0.5);
  transform: translateY(-2px);
}

.botao-vizinho:disabled {
  opacity: 0.4;
  cursor: default;
}

.previa-vizinho {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  padding: 8px;
  border: 1px solid var(--cor-1, #f0c969);
  border-radius: 8px;
  background: #0a0f1a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.previa-vizinho img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (hover: hover) {
  .botao-vizinho:hover:not(:disabled) .previa-vizinho,
  .botao-vizinho:focus-visible .previa-vizinho {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 700px) {
  .navegacao-ficha #voltar-pokedex,
  .vizinhos,
  .botao-vizinho {
    flex: 1 1 100%;
    justify-content: center;
  }

  .botao-vizinho {
    flex-basis: 0;
    min-height: 36px;
  }

  .navegacao-ficha #voltar-pokedex {
    padding-block: 8px;
  }
}

/* =================================
   CADEIA RAMIFICADA: SETAS DIAGONAIS PARA A DIREITA
================================= */

.cadeia-diagonal .grupo-evolucao,
.cadeia-diagonal .ramo-evolucao {
  flex-direction: row;
}

.cadeia-diagonal > .grupo-evolucao {
  position: relative;
}

.cadeia-diagonal .ramificacoes-evolucao {
  align-items: flex-start;
  gap: 24px;
}

.cadeia-diagonal .ramificacoes-evolucao.bifurcadas {
  margin-left: 110px;
}

.setas-diagonais {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.setas-diagonais line {
  stroke: #f0c969;
  stroke-width: 2;
}

.card-evolucao > .conector-evolucao {
  width: 100%;
  padding: 4px 0 0;
}

.card-evolucao > .conector-evolucao .condicao-evolucao {
  font-size: 11px;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .cadeia-diagonal .card-evolucao {
    width: 96px;
    padding: 8px 4px;
  }

  .cadeia-diagonal .card-evolucao img {
    width: 60px;
    height: 60px;
  }

  .cadeia-diagonal .card-evolucao h4 {
    font-size: 12px;
  }

  .cadeia-diagonal .ramificacoes-evolucao.bifurcadas {
    margin-left: 48px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao {
    width: 72px;
    padding: 0 4px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao .condicao-evolucao {
    font-size: 10px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao .seta-evolucao {
    width: 40px;
    height: 2px;
    background: #f0c969;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao .seta-evolucao::after {
    top: -5px;
    right: -2px;
    bottom: auto;
    left: auto;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #f0c969;
    border-right: 0;
  }
}

/* celular: os três estágios cabem na largura da tela */

@media (max-width: 700px) {
  .cadeia-diagonal {
    padding-inline: 0;
  }

  .cadeia-diagonal .card-evolucao {
    width: 76px;
    padding: 8px 2px;
  }

  .cadeia-diagonal .card-evolucao img {
    width: 52px;
    height: 52px;
  }

  .cadeia-diagonal .card-evolucao h4 {
    font-size: 10px;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .cadeia-diagonal .card-evolucao .tipos span {
    padding-inline: 3px;
    font-size: 8px;
  }

  .cadeia-diagonal .ramificacoes-evolucao.bifurcadas {
    margin-left: 22px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao {
    width: 44px;
    padding: 0 1px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao .condicao-evolucao {
    font-size: 9px;
  }

  .cadeia-diagonal .ramo-evolucao > .conector-evolucao .seta-evolucao {
    width: 30px;
  }
}

/* ============================================================
   CAMADA VISUAL DA POKÉDEX (antes em pokedex-visual.css)
   Só aparência: cada card herda a cor do tipo principal.
   Fica no fim do arquivo de propósito, para sobrescrever
   as regras básicas acima.
   ============================================================ */

/* ---------- Fundo: linhas de tela CRT bem discretas ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(0, 0, 0, 0.07) 3px 4px
  );
}

/* ---------- Introdução ---------- */

#inicio {
  padding: 46px 20px 12px;
}

#inicio::before {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #f0c969;
  border-radius: 50%;
  background: linear-gradient(#db5964 0 42%, #0a0f1a 42% 58%, #e8edf7 58%);
  box-shadow: 0 0 22px rgba(240, 201, 105, 0.35);
}

#inicio h2 {
  margin-bottom: 14px;
  color: #f0c969;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 3.2vw, 26px);
  line-height: 1.5;
  letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(240, 201, 105, 0.3), 3px 3px 0 rgba(0, 0, 0, 0.45);
}

#inicio p {
  font-size: 19px;
  letter-spacing: 0.5px;
}

/* ---------- Busca ---------- */

.area-busca label {
  color: #f0c969;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
}

.campo-busca input {
  padding: 16px 48px 16px 52px;
  background: rgba(12, 14, 24, 0.95);
  border: 2px solid #334664;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 600;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.campo-busca input:hover {
  border-color: #3a4c6c;
}

.campo-busca input:focus {
  border-color: #f0c969;
  background: rgba(16, 19, 32, 0.98);
  box-shadow: 0 0 0 4px rgba(240, 201, 105, 0.16), 0 0 28px rgba(102, 139, 216, 0.3);
}

.campo-busca .icone-busca {
  left: 20px;
}

/* ---------- Divisórias de geração ---------- */

.lista-pokemon .divisoria-geracao {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 46px 0 18px;
  padding: 0;
  border-bottom: 0;
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.lista-pokemon .divisoria-geracao::before,
.lista-pokemon .divisoria-geracao::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #668bd8 60%, #f0c969);
}

.lista-pokemon .divisoria-geracao::after {
  transform: scaleX(-1);
}

/* ---------- Cards ---------- */

/* cor de cada tipo (usada só pelos cards) */

.lista-pokemon .card-pokemon:has(.tipos span:first-child.fogo)      { --t: #ee6c4d; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.agua)      { --t: #5b95e0; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.planta)    { --t: #6fc06a; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.eletrico)  { --t: #f0c93a; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.veneno)    { --t: #b270c8; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.inseto)    { --t: #b4de4f; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.gelo)      { --t: #8fe8ee; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.terrestre) { --t: #e0b878; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.pedra)     { --t: #b8a46a; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.normal)    { --t: #a8a8a8; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.lutador)   { --t: #d9524a; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.voador)    { --t: #a8bfe6; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.dragao)    { --t: #6a73f0; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.fada)      { --t: #f59af8; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.aço)       { --t: #b8c2d0; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.sombrio)   { --t: #7a7ea8; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.fantasma)  { --t: #9b60e0; }
.lista-pokemon .card-pokemon:has(.tipos span:first-child.psiquico)  { --t: #ee5a9e; }

.lista-pokemon .card-shiny { --t: #f6e27a; }

.lista-pokemon .card-pokemon {
  --t: #668bd8;

  gap: 16px;
  padding: 14px 16px 14px 14px;
  background:
    radial-gradient(circle at 16% 50%, color-mix(in srgb, var(--t) 20%, transparent), transparent 60%),
    linear-gradient(135deg, rgba(36, 35, 56, 0.97), rgba(20, 20, 33, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--t);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.3s,
    box-shadow 0.3s,
    background-color 0.3s;
}

/* pokébola de fundo: gira quando o card é tocado */

.lista-pokemon .card-pokemon::before {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 112px;
  height: 112px;
  border: 5px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 15px, rgba(255, 255, 255, 0.05) 15px 20px, transparent 20px),
    linear-gradient(transparent 45%, rgba(255, 255, 255, 0.05) 45% 55%, transparent 55%);
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
}

.lista-pokemon .card-pokemon:hover,
.lista-pokemon .card-pokemon:focus-visible {
  background-color: transparent;
  border-color: var(--t);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.38),
    0 0 26px color-mix(in srgb, var(--t) 38%, transparent);
  transform: translateY(-6px);
}

.lista-pokemon .card-pokemon:hover::before,
.lista-pokemon .card-pokemon:focus-visible::before {
  border-color: color-mix(in srgb, var(--t) 45%, transparent);
  transform: rotate(180deg);
}

.lista-pokemon .card-pokemon:active {
  transform: translateY(-2px) scale(0.98);
}

/* sprite sobre um pedestal redondo na cor do tipo */

.lista-pokemon .card-pokemon img {
  width: 82px;
  height: 82px;
  padding: 4px;
  background:
    radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--t) 34%, transparent), transparent 72%),
    #15151f;
  border: 2px solid color-mix(in srgb, var(--t) 50%, #202030);
  border-radius: 50%;
  transition: border-color 0.3s, filter 0.3s;
}

.lista-pokemon .card-pokemon:hover img,
.lista-pokemon .card-pokemon:focus-visible img {
  border-color: var(--t);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
  transform: none;
  animation: salto-sprite 0.5s steps(4) 1;
}

@keyframes salto-sprite {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-9px); }
  70%      { transform: translateY(-3px); }
}

/* número em "etiqueta" dourada */

.lista-pokemon .card-pokemon .numero {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  color: #f0c969;
  background: rgba(240, 201, 105, 0.1);
  border: 1px solid rgba(240, 201, 105, 0.3);
  border-radius: 4px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0;
}

.lista-pokemon .card-pokemon h3 {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.lista-pokemon .card-pokemon .tipos span {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---------- Celular ---------- */

@media (max-width: 550px) {
  #inicio {
    padding-top: 34px;
  }

  .lista-pokemon .card-pokemon img {
    width: 70px;
    height: 70px;
  }

  .lista-pokemon .divisoria-geracao {
    gap: 12px;
    font-size: 11px;
  }

  .campo-busca input {
    font-size: 17px;
  }
}

/* ---------- Menos movimento ---------- */

@media (prefers-reduced-motion: reduce) {
  .lista-pokemon .card-pokemon::before,
  .lista-pokemon .card-pokemon img {
    animation: none !important;
    transition: none !important;
  }
}
