/* Estilos generales modernizados */
.game {
    text-align: center;
    font-family: 'Nunito', Arial, sans-serif;
    max-width: 90vw;
    margin: 0 auto;
    background-image: url('https://www.domenc.com/wp-content/uploads/2025/01/fondo-juegos-02-scaled.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px 10px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
}

.timer, .score {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.2);
    transition: transform 0.3s ease;
}

.timer:hover, .score:hover {
    transform: translateY(-3px);
}

.fruit-container {
    background-color: white;
    margin: 20px auto;
    padding: 25px;
    border: none;
    border-radius: 20px;
    display: inline-block;
    max-width: 90vw;
    min-height: 200px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.fruit-container:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.fruits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    font-size: 50px;
    animation: bounceIn 0.8s;
}

.fruits span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.fruits span:hover {
    transform: scale(1.2) rotate(10deg);
}

.button-options {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.button-options button {
    padding: 12px 25px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(56, 249, 215, 0.25);
    min-width: 80px;
}

.button-options button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(56, 249, 215, 0.4);
    background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%);
}

.button-options button:active {
    transform: translateY(2px);
}

.status {
    font-size: 28px;
    font-weight: bold;
    margin-top: 20px;
    height: 40px;
    transition: all 0.3s ease;
}

.celebration {
    position: relative;
    margin-top: 20px;
    font-size: 40px;
    height: 60px;
    opacity: 0;
    transition: all 0.5s ease;
}

.celebration.show {
    opacity: 1;
    animation: celebration 2s ease-out;
}

@keyframes celebration {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Estilos para el popup de instrucciones */
.instructions-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
    z-index: 10;
    transition: all 0.3s ease;
}

.instructions-button:hover {
    transform: rotate(15deg) scale(1.1);
}

.instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.instructions-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.instructions-popup {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.instructions-overlay.visible .instructions-popup {
    transform: scale(1);
}

.instructions-popup h2 {
    color: #333;
    margin-top: 0;
    font-size: 24px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.instructions-popup p {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

.instructions-popup ul {
    padding-left: 20px;
}

.instructions-popup li {
    margin-bottom: 10px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
}

.close-button:hover {
    color: #333;
    transform: rotate(90deg);
}

/* Animaciones adicionales */
@keyframes fruit-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.animated-fruit {
    display: inline-block;
    animation: fruit-bounce 2s infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

/* Estilos responsivos para dispositivos m¨®viles */
@media (max-width: 600px) {
    .fruits {
        font-size: 35px;
        gap: 10px;
    }
    
    .button-options button {
        padding: 10px 20px;
        font-size: 18px;
    }
    
    .instructions-popup {
        padding: 20px;
        max-width: 90%;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .timer, .score {
        width: 80%;
    }
}