@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ======= VARIÁVEIS GLOBAIS ======= */
:root {
  --font-color: white;
  --blue-player-bg: #015596;
  --blue-player-border: #2d9ad1;
  --red-player-bg: #7d0a02;
  --red-player-border: #eb0322;
  --button-color: #feb21a;
  --primary: #00e5ff;
}

/* ======= BASE ======= */
body {
  background: url("../img/fundo.png") center/cover fixed no-repeat;
  color: var(--font-color);
  font-family: "Roboto Mono", monospace;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

h1 { text-align: center; margin: 1rem 0; }

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

/* ======= CONTAINER PRINCIPAL ======= */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 15px 0;
}

/* ======= CARDS DOS JOGADORES ======= */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 90%;
}

.card-azul { border: 3px solid var(--blue-player-border); }
.card-vermelho { border: 3px solid var(--red-player-border); }
.card-azul h2 { color: var(--blue-player-border); }
.card-vermelho h2 { color: var(--red-player-border); }

.search-poke {
  width: 75%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, var(--blue-player-border), var(--blue-player-bg) 60%);
}

.player-red .search-poke {
  background: linear-gradient(180deg, var(--red-player-border), var(--red-player-bg) 60%);
}

/* ======= CADA POKÉMON NA ARENA ======= */
.pokemon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 10px 0;
}

.poke-img { width: 60%; height: auto; }

.poke-infor {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #00000075;
  border-top: 1px solid #fff;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 8px;
  gap: 8px;
}

.poke-name { font-size: 1.3rem; text-align: center; text-transform: capitalize; }

.atributes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.hp, .ataque, .defesa {
  border: 1px solid #fff;
  padding: 4px 6px;
  display: flex;
  justify-content: space-between;
}

/* ======= STATUS DA BATALHA (CENTRALIZADO) ======= */
.status-batalha {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url(../img/status-batalha-fundo.png) center/cover no-repeat;
  border: 0.5rem solid;
  border-color: var(--red-player-border) var(--red-player-border) var(--blue-player-border) var(--blue-player-border);
  border-radius: 0.6rem;
  width: 80%;
  padding: 1.5rem;
  gap: 1rem;
  text-align: center;
}

/* BOTÃO BATALHAR */
.status-batalha button {
  background-color: var(--button-color);
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.6rem;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.3s;
  color: #000;
  box-shadow: 0 0 10px rgba(254, 178, 26, 0.3);
}

.status-batalha button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(254, 178, 26, 0.6);
}

/* ======= MODAL DE ESCOLHA ======= */
.modal-poke {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

.modal {
  background: rgba(10, 20, 35, 0.8);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 20px;
  width: 90%;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* BARRA DE PESQUISA DO MODAL */
.modal form {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.modal form input {
  width: 300px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.modal form button {
  background: var(--primary);
  color: #001018;
  padding: 0 20px;
  border-radius: 12px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

/* ======= GRID DE CARDS ======= */
.cards-poke {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 20px; /* ESPAÇO PARA NÃO AMONTOAR */
  width: 100%;
  overflow-y: auto;
  padding: 10px;
}

.card-azul:has(.poke-img) {
    border-color: #00e5ff;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.6);
    background: rgba(0, 229, 255, 0.1);
}

.card-vermelho:has(.poke-img) {
    border-color: #ff4d4d;
    box-shadow: 0 0 25px rgba(255, 77, 77, 0.6);
    background: rgba(255, 77, 77, 0.1);
}

.poke-option {
  flex: 0 0 auto;
  width: 130px;
  height: 160px;
  background: rgba(10, 20, 35, 0.85);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: 0.2s;
  cursor: pointer;
}

.poke-option:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
}

.cards-poke:hover .poke-option:not(:hover) {
    opacity: 0.4;
    filter: grayscale(100%) blur(1px);
    transform: scale(0.95);
}

.poke-option img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}

.poke-option span {
  font-size: 0.9rem;
  color: #c8f6ff;
  text-align: center;
  font-weight: 600;
  text-transform: capitalize;
}

/* ======= BOTÃO VER MAIS ======= */
.btn-page {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 15px 0;
}

.btn-page button {
  padding: 10px 25px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: 0.3s;
}

.btn-page button:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* ======= MODAL DE RESULTADO ======= */
.modal.result-modal {
  height: auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.winner-container { display: flex; justify-content: center; gap: 15px; margin: 15px 0; }
.winner-img { width: 130px; height: auto; object-fit: contain; }

/* BOTÃO JOGAR NOVAMENTE */
.modal.result-modal button {
  margin-top: 20px;
  padding: 12px 30px;
  background-color: var(--button-color);
  border: none;
  border-radius: 10px;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 0 15px rgba(254, 178, 26, 0.4);
  text-transform: uppercase;
}

.modal.result-modal button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(254, 178, 26, 0.8);
}

/* ======= RESPONSIVIDADE ======= */
@media (min-width: 900px) {
  .container { flex-direction: row; align-items: flex-start; }
  .card { flex: 1; max-width: 360px; }
  .status-batalha { flex: 0 0 300px; }
}

/* ======= AJUSTE DOS ESTADOS DE BATALHA ======= */


.status-batalha button {
    display: none; 
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Classe para mostrar o botão quando estiver pronto */
.status-batalha button.mostrar {
    display: block !important;
    opacity: 1 !important;
    animation: pulsar 1.5s infinite ease-in-out;
}

/* EFEITO DE PULSAR */
@keyframes pulsar {
    0% { transform: scale(1); box-shadow: 0 0 0px rgba(254, 178, 26, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(254, 178, 26, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 0px rgba(254, 178, 26, 0.7); }
}