* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: #ff2a2a;
    text-align: center;
    padding: 15px;
}

.titol img {
    width: 220px;
}

.buscador {
    margin: 10px;
}

input {
    padding: 10px;
    width: 250px;
    border-radius: 10px;
    font-family: Arial;
}

button {
    padding: 10px 15px;
    border-radius: 10px;
    background: #ffcc00;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.cargar {
    position: absolute;
    top: 41%;
    left: 21%;
    width: 58%;
    height: 44%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cargar img {
    width: 75%;
    animation: rodar 0.7s linear infinite;
}

@keyframes rodar {
    100% {
        transform: rotate(360deg);
    }
}

.nav-rotom {
    position: absolute;
    bottom: 13%;
    left: 21%;
    width: 58%;
    display: flex;
    justify-content: space-between;
    z-index: 3;
}

.nav-rotom button {
    padding: 3px 10px;
    font-size: 14px;
    border-radius: 8px;
    background: #ffcc00;
    border: none;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.nav-rotom button:hover {
    background: #e6b800;
}

.cargar.hidden {
    display: none;
}

.rotom {
    position: relative;
    width: 520px;
    margin: 10px auto;
}

.tv-bg {
    width: 100%;
    display: block;
}

.pantalla {
    position: absolute;
    top: 41%;
    left: 21%;
    width: 58%;
    height: 44%;
    z-index: 2;
    overflow: hidden;
    color: #0a1a1a;
}

.poke-pantalla {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 45% 55%;
    grid-template-rows: auto 1fr auto;
    padding: 8px 19px 6px 8px;
    gap: 3px;
    background: transparent;
}

.poke-header {
    grid-column: 1 / 3;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    padding-bottom: 3px;
    margin-bottom: 2px;
}

.poke-nombre {
    font-weight: bold;
    font-size: 13px;
    text-transform: capitalize;
    color: #0a1a1a;
}

.poke-id {
    font-size: 11px;
    color: #2a3a3a;
    font-weight: bold;
}

.poke-foto {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poke-foto img {
    width: 150px;
    image-rendering: pixelated;
}

.poke-info {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 4px;
    padding-top: 5px;
}

.poke-desc {
    font-size: 8px;
    line-height: 1.3;
    color: #1a2a2a;
    margin-bottom: 3px;
    max-height: 32px;
    overflow: hidden;
    font-weight: bold;
}

.poke-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px 4px;
    font-size: 12px;
    margin-top: 10px;
}

.poke-stats span {
    text-align: left;
    white-space: nowrap;
}

.stat-val {
    font-weight: bold;
}

.poke-footer {
    grid-column: 1 / 3;
    grid-row: 3;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    padding-top: 3px;
    font-size: 9px;
    margin-bottom: 5px;
    padding-left: 3px;
}

.poke-gen {
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.poke-habitat {
    color: #2a4a3a;
    font-size: 12px;
    text-transform: capitalize;
}

.poke-tipus {
    font-weight: bold;
    text-transform: uppercase;    
    display: flex;
    gap: 5px;
}

.tipusCajita {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    margin-left: 5px;

}

#error {
    position: absolute;
    top: 41%;
    left: 21%;
    width: 58%;
    height: 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: bold;
    font-size: 11px;
    z-index: 2;
    text-align: center;
    padding: 10px;
}

#botones {
    margin: 8px 0;
}

#cartes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 20px;
}

article {
    background: white;
    border-radius: 12px;
    padding: 10px;
}

article img {
    width: 80px;
    height: 100px;
}

article h3 {
    font-size: 12px;
    text-transform: capitalize;
    margin: 4px 0 2px;
}

article small {
    font-size: 10px;
    color: #555;
}

@media (max-width: 900px) {
    #cartes {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    #cartes {
        grid-template-columns: repeat(2, 1fr);
    }

    .rotom {
        width: 95%;
    }
}

footer {
    margin-top: 20px;
    color: white;
    font-family: Arial;
}

footer a {
    color: white;
    transition-duration: 0.5;
}

footer a:hover {
    color: yellow;
}