/* Estilos para el menú de modos de juego */
.game-modes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 25, 35, 0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem 2rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto;
}

.game-modes-container.active {
    opacity: 1;
    visibility: visible;
}

/* Animación para las tarjetas de modos de juego */
.game-mode-card {
    position: relative;
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.game-modes-container.active .game-mode-card {
    transform: translateY(0);
    opacity: 1;
}

/* Efecto hover y animación del borde */
@media (min-width: 769px) {
    .game-mode-card:hover {
        transform: scale(1.03);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }
}

.game-mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-color);
    box-sizing: border-box;
    clip-path: inset(0 100% 100% 0);
    transition: clip-path 0.3s ease;
    z-index: 6;
    pointer-events: none;
}

.game-mode-card:hover::before {
    clip-path: inset(0 0 0 0);
    animation: borderAnimation 1.2s infinite alternate;
}

@keyframes borderAnimation {
    0% {
        border-color: var(--primary-color);
        box-shadow: 0 0 10px var(--primary-color);
    }
    100% {
        border-color: var(--primary-hover-color);
        box-shadow: 0 0 20px var(--primary-hover-color);
    }
}

.game-modes-container.active .game-mode-card:nth-child(1) {
    transition-delay: 0.1s;
}

.game-modes-container.active .game-mode-card:nth-child(2) {
    transition-delay: 0.2s;
}

.game-modes-container.active .game-mode-card:nth-child(3) {
    transition-delay: 0.3s;
}

.game-modes-container.active .game-mode-card:nth-child(4) {
    transition-delay: 0.4s;
}

.game-modes-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}

.game-modes-title {
    color: white;
    font-size: 6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-top: 1rem;
    width: 100%;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.game-modes-container.active .game-modes-title {
    opacity: 1;
    transform: translateY(0);
}

.back-button {
    color: white;
    font-size: 3rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease, opacity 0.5s ease, transform 0.5s ease;
    cursor: pointer;
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 101;
    opacity: 0;
    transform: translateX(-20px);
}

.game-modes-container.active .back-button {
    opacity: 1;
    transform: translateX(0);
}

/* Estilos para la descripción del modo de juego */
.game-mode-description-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 60%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
    z-index: 2;
}

@media (min-width: 769px) {
    .game-mode-card:hover .game-mode-description-overlay {
        bottom: 13%;
        opacity: 1;
    }
}

.game-mode-description {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 100%;
}

.back-button:hover {
    color: var(--primary-color);
}

.game-modes-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    flex-wrap: wrap;
    margin-top: 1rem;
    overflow-y: auto;
}

.game-mode-card {
    width: 300px;
    height: 350px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Media Queries para el menú de modos de juego */
/* Tablets */
@media (max-width: 1024px) {
    .game-modes-title {
        font-size: 5rem;
    }
    
    .game-modes-grid {
        gap: 1.5rem;
    }
    
    .game-mode-card {
        width: 280px;
        height: 330px;
    }
}

/* Mobile Phones */
@media (max-width: 768px) {
    .game-modes-header {
        margin-bottom: 1rem;
    }
    
    .game-modes-title {
        font-size: 4rem;
        margin-top: 3rem;
    }
    
    .back-button {
        font-size: 2.5rem;
        top: 0.2rem;
        left: 0.1rem;
    }
    
    .game-modes-grid {
        gap: 1.2rem;
    }
    
    .game-mode-card {
        width: 250px;
        height: 300px;
    }
    
    .game-mode-title {
        font-size: 1.8rem;
    }
    
    .game-mode-description {
        font-size: 1rem;
    }
    
    /* Evitar que se muestre la descripción en móviles */
    .game-mode-card:hover .game-mode-description-overlay {
        bottom: -100%;
        opacity: 0;
    }
    
    /* Modificar el efecto hover para que solo muestre el borde sin mover la tarjeta */
    .game-mode-card:hover {
        transform: none;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    .game-modes-container {
        padding: 0 1rem 1rem 1rem;
    }
    
    .game-modes-title {
        font-size: 3rem;
        margin-top: 3.5rem;
    }
    
    .back-button {
        font-size: 2rem;
        top: 1rem;
        left: 1rem;
    }
    
    .game-modes-grid {
        gap: 1rem;
    }
    
    .game-mode-card {
        width: 220px;
        height: 260px;
    }
    
    .game-mode-title {
        font-size: 1.5rem;
    }
    
    .game-mode-description {
        font-size: 0.9rem;
    }
    
    .game-mode-description-overlay {
        height: 70%;
    }
    
    /* Evitar que se muestre la descripción en móviles pequeños */
    .game-mode-card:hover .game-mode-description-overlay {
        bottom: -100%;
        opacity: 0;
    }
    
    /* Modificar el efecto hover para que solo muestre el borde sin mover la tarjeta */
    .game-mode-card:hover {
        transform: none;
    }
}

/* Efecto hover solo para escritorio */
@media (min-width: 769px) {
    .game-mode-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Estilos para el indicador de cooldown */
.game-mode-cooldown {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.game-mode-cooldown::after {
    content: attr(data-cooldown);
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ff4655;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
}

.game-mode-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
}

.game-mode-title {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .game-modes-title {
        font-size: 4rem;
    }
    
    .game-mode-card {
        width: 250px;
        height: 350px;
    }
    
    .game-mode-image {
        height: 250px;
    }
    
    .game-mode-title {
        font-size: 2.5rem;
    }
}