/* ========================================================================== */
/* JUEGO CAPIBARA ESQUIVANDO AVES - ESTILOS CORREGIDOS CON SISTEMA SIMON */
/* ========================================================================== */

.juego-esquiva-aves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2147483645;
    touch-action: none;
    overflow: hidden;
    pointer-events: auto;
}

/* Capibara jugador */
.capibara-esquiva {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B7355, #A0522D);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    transition: all 0.2s ease-out;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.5);
    touch-action: none;
    user-select: none;
    pointer-events: auto;
    transform-origin: center;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
}

.emoji-capibara {
    font-size: 40px !important;
    line-height: 1 !important;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.9) !important;
    color: white !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    text-align: center !important;
}

.capibara-esquiva.arrastrando {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.6);
    border-color: #fff;
    background: rgba(160, 82, 45, 0.9);
}

/* Aves enemigas - SISTEMA SIMON APLICADO */
.ave-esquiva {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483646;
    transition: top 0.1s linear;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid rgba(255, 255, 255, 0.7);
    overflow: visible !important;
}

/* Tamaños base para las esferas (solo se usarán si no hay imagen) */
.pato-esquiva {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.cisne-esquiva {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #FFFFFF, #E0E0E0);
}

.pajaro-esquiva {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #87CEEB, #1E90FF);
}

.emoji-ave-esquiva {
    font-size: 30px !important;
    line-height: 1 !important;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
}

/* ========================================================================== */
/* SISTEMA DE IMÁGENES IDÉNTICO AL SIMON - TAMAÑOS RESPONSIVE REALES */
/* ========================================================================== */

/* CONTENEDOR INTERNO PARA CENTRADO PERFECTO - IGUAL QUE SIMON */
.ave-esquiva > div {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* IMÁGENES SUPERPUESTAS - SISTEMA IDÉNTICO AL SIMON */
.img-ave-esquiva {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: contain !important; /* CONTAIN PARA VER IMAGEN COMPLETA */
    z-index: 4 !important;
    pointer-events: none !important;
    transform-origin: center center !important;
    background: transparent !important;
}

/* OCULTAR COMPLETAMENTE EMOJI CUANDO HAY IMAGEN */
.ave-esquiva.con-imagen .emoji-ave-esquiva {
    display: none !important;
}

/* OCULTAR COMPLETAMENTE LA ESFERA CUANDO HAY IMAGEN - IGUAL QUE SIMON */
.ave-esquiva.con-imagen {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* ========================================================================== */
/* TAMAÑOS RESPONSIVE IDÉNTICOS AL SIMON */
/* ========================================================================== */

/* TELÉFONOS PEQUEÑOS */
@media (max-width: 480px) {
    .ave-esquiva.con-imagen {
        width: 110px !important;
        height: 110px !important;
    }
    
    .pato-esquiva:not(.con-imagen) { width: 110px !important; height: 110px !important; }
    .cisne-esquiva:not(.con-imagen) { width: 130px !important; height: 130px !important; }
    .pajaro-esquiva:not(.con-imagen) { width: 100px !important; height: 100px !important; }
}

/* TELÉFONOS MEDIANOS */
@media (min-width: 481px) and (max-width: 767px) {
    .ave-esquiva.con-imagen {
        width: 125px !important;
        height: 125px !important;
    }
    
    .pato-esquiva:not(.con-imagen) { width: 125px !important; height: 125px !important; }
    .cisne-esquiva:not(.con-imagen) { width: 145px !important; height: 145px !important; }
    .pajaro-esquiva:not(.con-imagen) { width: 115px !important; height: 115px !important; }
}

/* TABLETS PEQUEÑAS (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .ave-esquiva.con-imagen {
        width: 240px !important;
        height: 240px !important;
    }
    
    .pato-esquiva:not(.con-imagen) { width: 240px !important; height: 240px !important; }
    .cisne-esquiva:not(.con-imagen) { width: 260px !important; height: 260px !important; }
    .pajaro-esquiva:not(.con-imagen) { width: 220px !important; height: 220px !important; }
}

/* TABLETS GRANDES (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
    .ave-esquiva.con-imagen {
        width: 280px !important;
        height: 280px !important;
    }
    
    .pato-esquiva:not(.con-imagen) { width: 280px !important; height: 280px !important; }
    .cisne-esquiva:not(.con-imagen) { width: 300px !important; height: 300px !important; }
    .pajaro-esquiva:not(.con-imagen) { width: 260px !important; height: 260px !important; }
}

/* PANTALLAS MUY GRANDES (más de 1367px) */
@media (min-width: 1367px) {
    .ave-esquiva.con-imagen {
        width: 300px !important;
        height: 300px !important;
    }
    
    .pato-esquiva:not(.con-imagen) { width: 300px !important; height: 300px !important; }
    .cisne-esquiva:not(.con-imagen) { width: 320px !important; height: 320px !important; }
    .pajaro-esquiva:not(.con-imagen) { width: 280px !important; height: 280px !important; }
}

/* ========================================================================== */
/* FORZAR ESTILOS - ANULAR CUALQUIER CONFLICTO */
/* ========================================================================== */

.juego-esquiva-aves .ave-esquiva.con-imagen .img-ave-esquiva {
    max-width: none !important;
    max-height: none !important;
    min-width: auto !important;
    min-height: auto !important;
    object-fit: contain !important; /* CONTAIN PARA VER IMAGEN COMPLETA */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    transform-origin: center center !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    border-radius: 50% !important;
    background: transparent !important;
}

.juego-esquiva-aves .ave-esquiva {
    overflow: visible !important;
}

.juego-esquiva-aves .ave-esquiva.con-imagen {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* ANULAR CUALQUIER ESTILO GLOBAL */
.juego-esquiva-aves img {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
}

.juego-esquiva-aves .img-ave-esquiva {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
}

/* MANEJO DE ERRORES */
.img-ave-esquiva.error {
    display: none !important;
}

.img-ave-esquiva.error ~ .emoji-ave-esquiva {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ========================================================================== */
/* TABLERO DE PUNTUACIÓN */
/* ========================================================================== */

.contador-defensa {
    position: fixed !important;
    bottom: 90px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(190, 150, 120, 0.6) !important;
    color: white;
    padding: 8px 15px !important;
    border-radius: 14px;
    font-size: 16px;
    z-index: 2147483646 !important;
    font-family: 'Fredoka', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    pointer-events: auto;
    backdrop-filter: blur(5px) !important;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: center;
    display: none !important;
    justify-content: space-around;
    align-items: center;
    flex-wrap: nowrap;
}

.contador-defensa.mostrar {
    display: flex !important;
}

.contador-defensa div {
    margin: 0 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    font-weight: bold;
    white-space: nowrap;
    font-size: 16px;
}

.tiempo-restante { 
    color: #4fc3f7 !important;
}

.insectos-eliminados { 
    color: #69f0ae !important;
}

.vidas-restantes { 
    color: #ff5252 !important;
}

/* Resto del CSS... */
html body .contador-defensa {
    bottom: 80px !important;
}

@media (max-width: 768px) {
    .contador-defensa {
        padding: 8px 12px !important;
        font-size: 16px;
        max-width: 400px;
    }
    
    .contador-defensa div {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .contador-defensa {
        padding: 6px 10px !important;
        font-size: 16px;
        max-width: 300px;
    }
    
    .contador-defensa div {
        font-size: 16px;
    }
}

.mensaje-esquiva-aves {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 30px 50px;
    border-radius: 25px;
    font-size: 32px;
    font-weight: bold;
    z-index: 2147483647;
    text-align: center;
    border: 5px solid gold;
    box-shadow: 0 0 40px rgba(255,215,0,0.6);
    display: none;
}

.mensaje-esquiva-aves.mostrar {
    display: block;
}

.indicador-controles-esquiva {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    z-index: 2147483647;
    font-family: 'Fredoka', sans-serif;
    border: 4px solid #4CAF50;
    display: none;
    max-width: 90%;
}

.indicador-controles-esquiva.mostrar {
    display: block;
}

.indicador-controles-esquiva h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #4CAF50;
}

.indicador-controles-esquiva p {
    margin: 10px 0;
    font-size: 18px;
}

@keyframes vibrar {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(calc(-50% - 5px)); }
    50% { transform: translateX(calc(-50% + 5px)); }
    75% { transform: translateX(calc(-50% - 3px)); }
}

.capibara-esquiva.colision {
    animation: vibrar 0.5s ease-in-out;
    background: linear-gradient(135deg, #ff4444, #ff6b6b) !important;
}

.confeti-esquiva {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0.8;
    z-index: 2147483646;
    animation: caerConfeti 5s linear forwards;
}

@keyframes caerConfeti {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.estrella-esquiva {
    position: fixed;
    font-size: 24px;
    z-index: 2147483646;
    animation: caerEstrella 3s linear forwards;
}

@keyframes caerEstrella {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}