/* Estilos para el modo ahorcado */

/* Contenedor principal */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: url('../src/backgrounds/fondo-mode-hangman.webp') center/cover no-repeat;
    color: white;
    font-family: 'Tungsten', Arial, sans-serif;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.7);
    z-index: 1;
}

.main-content > * {
    position: relative;
    z-index: 2;
}

/* Botón de regreso */
.back-button {
    position: absolute;
    top: 20px;
    left: 40px;
    background: rgba(255, 70, 85, 0.1);
    border: 2px solid #ff4655;
    color: #ff4655;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Tungsten', Arial, sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    opacity: 10;
}

.back-button:hover {
    background: #ff4655;
    color: white;
}

/* Logo */
.logo {
    margin: 10px 150px 10px 0;
}



.logo img {
    height: 80px;
    width: auto;
}

/* Selección de modo */
#mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.select-mode-text {
    font-size: 32px;
    font-weight: bold;
    color: #ff4655;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.mode-cards-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-card {
  background: linear-gradient(135deg, #1e2328 0%, #2a2d32 100%);
  border: 2px solid #3a3d42;
  border-radius: 15px;
  padding: 0;
  width: 314px;
  height: 362px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mode-card:hover {
    border-color: #ff4655;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 70, 85, 0.3);
}

.mode-card.in-cooldown {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.mode-card.in-cooldown:hover {
    transform: none;
    box-shadow: none;
    border-color: #666;
}

.mode-card.in-cooldown::after {
    content: attr(data-cooldown);
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 70, 85, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.mode-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.mode-text {
    font-size: 28px;
    font-weight: bold;
    color: #ff4655;
    text-align: center;
    letter-spacing: 2px;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2328 0%, #2a2d32 100%);
    border-radius: 0 0 15px 15px;
}

/* Juego principal */
#game-main {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin-top: 60px;
}

.mode-name-title {
    font-size: 36px;
    font-weight: bold;
    color: #ff4655;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* Área del juego */
.game-area {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

/* Canvas del ahorcado */
#hangman-canvas {
    border: 2px solid #3a3d42;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

/* Área de la palabra */
.word-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

#word-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.letter-space {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid #ff4655;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0 2px;
}

.letter-space.space {
    width: 20px;
    border-bottom: none;
    margin: 0 5px;
}

/* Teclado virtual */
#keyboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.keyboard-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.key-button {
    background: linear-gradient(135deg, #2a2d32 0%, #3a3d42 100%);
    border: 2px solid #4a4d52;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
    user-select: none;
}

.key-button:hover {
    background: linear-gradient(135deg, #3a3d42 0%, #4a4d52 100%);
    border-color: #ff4655;
    transform: translateY(-2px);
}

.key-button.correct {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    border-color: #00ff88;
    color: #1e2328;
    cursor: not-allowed;
}

.key-button.incorrect {
    background: linear-gradient(135deg, #ff4655 0%, #e63946 100%);
    border-color: #ff4655;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1e2328 0%, #2a2d32 100%);
    border: 2px solid #ff4655;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.success-title {
    color: #00ff88;
}

.failure-title {
    color: #ff4655;
}

.modal-message {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ccc;
}

.modal-word {
    font-size: 32px;
    font-weight: bold;
    color: #ff4655;
    margin: 20px 0;
    letter-spacing: 2px;
}

.modal-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #3a3d42;
}

.cooldown-info {
    background: rgba(255, 70, 85, 0.1);
    border: 1px solid #ff4655;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #ff4655;
}

.cooldown-text {
    font-size: 14px;
    margin-bottom: 5px;
}

.cooldown-time {
    font-size: 18px;
    font-weight: bold;
}

.close-modal {
    background: #ff4655;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-family: 'Tungsten', Arial, sans-serif;
    letter-spacing: 1px;
}

.close-modal:hover {
    background: #e63946;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .mode-cards-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .mode-card {
        width: 250px;
    }
    
    .game-area {
        flex-direction: column;
        gap: 30px;
    }
    
    #hangman-canvas {
        width: 200px;
        height: 250px;
    }
    
    .select-mode-text {
        font-size: 24px;
    }
    
    .mode-name-title {
        font-size: 28px;
    }
    
    .key-button {
        padding: 10px 12px;
        font-size: 16px;
        min-width: 35px;
    }
    
    .letter-space {
        width: 35px;
        height: 45px;
        font-size: 28px;
    }
    
    .letter-space.space {
        width: 15px;
        margin: 0 4px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 28px;
    }
    
    .modal-word {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .back-button {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .logo img {
        height: 60px;
    }
    
    .select-mode-text {
        font-size: 20px;
    }
    
    .mode-name-title {
        font-size: 24px;
    }
    
    .key-button {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 30px;
    }
    
    .letter-space {
        width: 30px;
        height: 40px;
        font-size: 24px;
    }
    
    .letter-space.space {
        width: 12px;
        margin: 0 3px;
    }
    
    #word-container {
        gap: 5px;
    }
    
    .modal-image {
        width: 100px;
        height: 100px;
    }
}