* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Capriola", sans-serif;
}
body {
    background: #f0f0f0;
}
header, header h1 {
    text-align: center;
    align-items: center;
    display: flex;
    flex-direction: column;
    background: #cc0000;
    color: rgb(255, 251, 0);
    padding: 20px;
    font-family: "Saira Stencil", sans-serif;
}
header input {
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    width: 300px;
    font-size: 16px;
}
#pokemon-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px;
}
#pokemon-container p {
    text-align: center;
    font-size: 18px;
}
.tarjeta {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.tarjeta:hover {
    transform: scale(1.05);
}
.tarjeta img {
    width: 96px;
    height: 96px;
}
.tarjeta h3 {
    text-transform: capitalize;
    margin: 8px 0 4px;
}
.tarjeta p {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    color: white;
    text-transform: capitalize;
}
.tipos {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.tipos span {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: white;
    font-weight: bold;
    text-transform: capitalize;
}
/* Colores por tipo */
.fire { background: #F08030; }
.water { background: #6890F0; }
.grass { background: #78C850; }
.poison { background: #A040A0; }
.normal { background: #A8A878; }
.bug { background: #A8B820; }
.flying { background: #A890F0; }
.electric { background: #F8D030; color: #333; }
.ground { background: #E0C068; }
.fairy { background: #EE99AC; }
.psychic { background: #F85888; }
.rock { background: #B8A038; }
.ice { background: #98D8D8; }
.ghost { background: #705898; }
.dragon { background: #7038F8; }
.fighting { background: #C03028; }
.dark { background: #705848; }
.steel { background: #B8B8D0; }

/* Spinner — aparece mientras cargan los pokémon */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top-color: #cc0000; /* el color que gira */
    border-radius: 50%;
    animation: girar 0.8s linear infinite; /* animación de giro */
}
@keyframes girar {
    to { transform: rotate(360deg); }
}

/* Modal — oculto por defecto */
.modal-oculto {
    display: none; /* invisible por defecto */
}
.modal-visible {
    display: flex; /* visible cuando se clickea una tarjeta */
    position: fixed; /* se queda fijo en la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* fondo oscuro semitransparente */
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-contenido {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    position: relative;
    min-width: 280px;
}
.modal-contenido img {
    width: 150px;
    height: 150px;
}
.modal-contenido h2 {
    text-transform: capitalize;
    font-size: 24px;
    margin: 12px 0 8px;
}
.modal-contenido p {
    font-size: 14px;
    margin: 4px 0;
}
#cerrar-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.219);
}

.stat-barra-fondo {
    background: #eee;
    border-radius: 10px;
    height: 8px;
    width: 100%;
}
.stat-barra-relleno {
    background: #cc0000;
    border-radius: 10px;
    height: 8px;
}
.stat-barra-relleno-hp {
    background: #14bd2a; 
    border-radius: 10px;
    height: 8px;
}
.stat-barra-relleno-defensa {
    background: #1e90ff; 
    border-radius: 10px;
    height: 8px;
}
.stat-barra-relleno-velocidad {
    background: #f8d030; 
    border-radius: 10px;
    height: 8px;
}
.estrella {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 20px;
    color: gold;
}
.numero {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 12px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.219);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
}
#modal-imagen {
    transition: opacity 0.3s ease;
}
.modal {
    position: relative;
}
.boton-shiny {
    position: absolute;
    top: 10px;
    left: 10px;

    background: rgba(0,0,0,0.4);
    border: none;
    border-radius: 50%;

    width: 36px;
    height: 36px;

    color: white;
    font-size: 16px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;

}
.botones-filtros {

    gap: 10px;
    margin-bottom: 20px;
}
.btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.4);
    cursor: pointer;
}
#controles {
    display: flex;
    margin-top: 10px;
    width: 100%;
    text-align: left;
    justify-content: flex-end;
}

.botones-filtros {
    display: flex;
    gap: 10px;
}
.rojo {
    background: #ff3b3b;
}

.amarillo {
    background: #ffd93b;
}

.verde {
    background: #4cd137;
}
.btn:hover {
    transform: scale(1.2);
}
.btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    
    background: #333;
    color: white;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 5px;

    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}
.btn:hover::after {
    opacity: 1;
}