body {
  margin: 0;
  background-color: #01534e;
}

nav{
   display:flex;
   justify-content: space-around;
   background-color: aquamarine;
}

nav img{
    /* width: 150px; */
      height: 140px;
      transition: transform 0.3s ease;
}

/* Animación */
nav img:hover {
  animation: girarSuave 0.6s ease-in-out;
}

@keyframes girarSuave {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(30deg); }
  50%  { transform: rotate(-30deg); }
  75%  { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

aside{
  display: flex;
  margin-top: 50px;
  background-color: aquamarine;

}

footer{
     background-color: aquamarine;
}



/* IA*/

section{
  display:flex;
  justify-content: center;
  flex-wrap:wrap;
  gap:20px;
  padding:20px;
}

section h3{
  color: #01534e;
  font-family: "Sedgwick Ave Display", cursive;
  font-weight: 400;
  font-style: normal;
  min-height: 2.4em; /* espacio constante para el nombre */
  line-height: 1.2em;
  margin: 0;
}

/* Ajuste específico dentro de la card: */
.card h3 {
    min-height: 2.4em; /* dos líneas aprox. */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5px;
}

section div{
 /* background:white;*/
  border-radius:10px;
  padding:10px;
  text-align:center;
  width:150px;
  transition:transform 0.2s;
}

section > div:hover{
  transform:scale(1.05);
  background-color:  rgb(83, 134, 117) ;
}


.card{
  background:rgb(154, 188, 189);
  border-radius:12px;
  padding:15px;
  text-align:center;
  width:250px;
  box-shadow:0 4px 10px rgba(0,0,0,0.2);
  transition:transform 0.2s;
}

/*.card:hover{
  transform:scale(1.07);
}*/

.tipos{
  display:flex;
  justify-content:center;
  gap:6px;
  margin-top:8px;
}

.tipo{/* Las letras de los tipos de la tarjeta */
  padding:4px 10px;
  border-radius:6px;
  color:white;
  font-size:12px;
  font-weight:bold;
}

.stats { /* Las letras de las estadísticas de la tarjeta */
  margin-top: 2px;
  text-align: left;
  font-size: 16px;
  color: #01534e;
}

/* Los div internos dentro de la card ocupan casi todo el ancho */
.card > div {
    width: 100%;          /* Ocupa todo el ancho de la card */
    box-sizing: border-box; /* Incluye padding dentro del ancho */
}

/* Tipos centrados */
.card .tipos {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap; /* Evita desbordes si hay muchos tipos */
}

/* Estadísticas */
.card .stats {
    display: flex;
    flex-direction: column; /* Para que cada línea quede vertical */
    width: 100%; /* Ocupa todo el ancho */
    box-sizing: border-box;
}

.stats.hidden {
    display: none;
}

/* Pop-up para stats */
.stats-popup {
    position: absolute;
    background: rgb(154, 188, 189);
    border: 2px solid aquamarine;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 200px;
    font-size: 14px;
    color: #01534e;
}

/* Asegura que las líneas de estadística no se desborden */
.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Mantiene nombre, valor y color en una sola línea */
}




.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-name {
    flex: 1;
    text-align: left;
}

.stat-value {
    width: 35px;
    text-align: right;
    margin-left: 5px;
}

.stat-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 5px;
}

.stat-highlight {
    background-color: white;
    border-radius: 6px;
}


.botones {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: center;
}


/*botones*/
.botones a {
    text-decoration: none;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-wiki {
    color: #01534e;
    background-color: aquamarine;
    border-bottom: #01534e 1px ;
}

.btn-pk {
    color: #01534e;
    background-color: aquamarine;
}

.btn-serebii {
    color: #01534e;
    background-color: aquamarine;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}


.botones a:hover {
    background-color: rgb(21, 179, 126);
    transform: scale(1.05);
    opacity: 0.85;
}

.posicion {
    color: aquamarine;
    font-weight: bold;
    margin-right: 6px;
}

.loading{
  color: white;
  font-weight: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
}

.loading p {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: aquamarine;
}

#countdown {
  font-size: 24px;
  color: #FFD700;
  font-weight: bold;
  min-width: 50px;
}

/* carousel styles */
.carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 20px;
}

.carousel-track-container {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s ease;
}



/* fade-in animation for cards */
.card {
    opacity: 1;
}
.card.new {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}
/* ensure any direct opacity transition also works as fallback */
.card {
    transition: opacity 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Colores según valor */
.verde-muy-alto { background: #00FF00; }  /* muy alta */
.verde { background: #b7f793; }           /* alta */
.amarillo { background: #FFFF33; }        /* media */
.naranja { background: #FF9933; }         /* baja */
.rojo { background: #FF3333; }            /* muy baja */

/* Total de estadísticas */
.total .stat-color {
    background: #0099FF;  /* azul para total */
}
.total .stat-name {
    font-weight: bold;
}
.total .stat-value {
    font-weight: bold;
}

/* 🎨 Colores oficiales */
.normal { background:#A8A77A; }
.fire { background:#EE8130; }
.water { background:#6390F0; }
.electric { background:#F7D02C; color:rgb(74, 78, 17); }
.grass { background:#7AC74C; }
.ice { background:#96D9D6; color:rgb(26, 56, 112); }
.fighting { background:#C22E28; }
.poison { background:#A33EA1; }
.ground { background:#E2BF65; color:rgb(133, 106, 18); }
.flying { background:#A98FF3; }
.psychic { background:#F95587; }
.bug { background:#A6B91A; }
.rock { background:#B6A136; }
.ghost { background:#735797; }
.dragon { background:#6F35FC; }
.dark { background:#705746; }
.steel { background:#B7B7CE; color:rgb(80, 77, 77); }
.fairy { background:#D685AD; }


/* Layout desktop (normal) */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
   /* background: white; */
    border-radius: 12px;
    padding: 15px;
    width: 170px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.info-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stats {
    width: 100%;
    margin-top: 10px;
    margin-right: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Media query móviles (<600px) */
@media screen and (max-width: 600px) {
    .card {
        flex-direction: row;        /* Dos bloques en fila */
        width: 100%;
        gap: 10px;
        align-items: flex-start;
    }

    .info-block {
        width: 50%;                 /* Bloque izquierdo */
        flex-direction: column;
        align-items: center;
    }

    .stats {
        width: 50%;                 /* Bloque derecho */
        flex-direction: column;
        align-items: flex-start;
    }

    .card h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}