body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Contenedor de batalla */
.battlefield {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 80px;
    width: 100%;
    max-width: 1200px;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Estilos de los Pokémon */
.pokemon {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 300px;
    text-align: center;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Imágenes de los Pokémon */
img {
    width: 120px;
    height: auto;
    max-width: 100%;
}

/* Contenedor de los botones de ataque */
.attack-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* Estilos de los botones de ataque */
.attack-buttons button {
    background: #3498db;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    min-height: 44px; /* Tamaño mínimo táctil recomendado */
}

.attack-buttons button:hover {
    background: #2980b9;
}

.attack-buttons button:active {
    transform: scale(0.98);
}

/* Botón de reinicio */
#restartGame {
    background: #ff4757;
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 44px;
    z-index: 100;
}

#restartGame:hover {
    background: #e84118;
}

#restartGame:active {
    transform: translateX(-50%) scale(0.98);
}

.pokemon.hit {
    animation: shake 0.4s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

.pokemon.evolve {
    animation: evolve-glow 1s;
    box-shadow: 0 0 30px 10px #ffe066;
}

@keyframes evolve-glow {
    0% { box-shadow: 0 0 0 0 #ffe066; }
    50% { box-shadow: 0 0 40px 20px #ffe066; }
    100% { box-shadow: 0 0 0 0 #ffe066; }
}

/* Pantallas pequeñas (hasta 480px) */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .pokemon {
        padding: 12px;
        max-width: 280px;
    }
    
    img {
        width: 100px;
    }
    
    .attack-buttons button {
        font-size: 13px;
        padding: 10px;
    }
    
    #restartGame {
        bottom: 15px;
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Tablets (481px a 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .battlefield {
        gap: 20px;
    }
    
    .pokemon {
        padding: 18px;
        max-width: 320px;
    }
    
    img {
        width: 130px;
    }
    
    .attack-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .attack-buttons button {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
    }
}

/* Pantallas medianas (768px a 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .battlefield {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
        flex-wrap: wrap;
    }
    
    .pokemon {
        width: 45%;
        max-width: 350px;
        padding: 20px;
    }
    
    img {
        width: 140px;
    }
    
    .attack-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .attack-buttons button {
        flex: 1;
        min-width: 90px;
        font-size: 15px;
    }
}

/* Pantallas grandes (1024px en adelante) */
@media (min-width: 1024px) {
    .battlefield {
        flex-direction: row;
        justify-content: center;
        gap: 40px;
        margin-bottom: 100px;
    }
    
    .pokemon {
        width: 40%;
        max-width: 400px;
        padding: 25px;
    }
    
    img {
        width: 160px;
    }
    
    .attack-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .attack-buttons button {
        flex: 1;
        min-width: 100px;
        font-size: 16px;
        padding: 12px;
    }
    
    .attack-buttons button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    #restartGame {
        bottom: 30px;
        padding: 15px 25px;
        font-size: 18px;
    }
    
    #restartGame:hover {
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
}

/* Pantallas extra grandes (1440px en adelante) */
@media (min-width: 1440px) {
    .battlefield {
        gap: 60px;
    }
    
    .pokemon {
        max-width: 450px;
        padding: 30px;
    }
    
    img {
        width: 180px;
    }
}

/* Orientación landscape para móviles */
@media (max-width: 767px) and (orientation: landscape) {
    body {
        min-height: auto;
        padding: 5px;
    }
    
    .battlefield {
        flex-direction: row;
        gap: 15px;
        margin-bottom: 60px;
    }
    
    .pokemon {
        width: 45%;
        padding: 10px;
    }
    
    img {
        width: 80px;
    }
    
    .attack-buttons button {
        padding: 6px;
        font-size: 12px;
        min-height: 36px;
    }
    
    #restartGame {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .attack-buttons button,
    #restartGame {
        transition: none;
    }
    
    .attack-buttons button:hover,
    #restartGame:hover {
        transform: none;
    }
    
    .attack-buttons button:active,
    #restartGame:active {
        transform: none;
    }
}

/* Alto contraste para accesibilidad */
@media (prefers-contrast: high) {
    .pokemon {
        border: 2px solid #000;
    }
    
    .attack-buttons button {
        border: 2px solid #000;
    }
    
    #restartGame {
        border: 2px solid #000;
    }
}