/* Estilos para el juego del Ahorcado - Frontend */

.hangman-game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #333;
}

/* Pantalla de inicio */
.hangman-start-screen {
    text-align: center;
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hangman-welcome h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #4a5568;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hangman-welcome p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.hangman-player-form {
    margin-bottom: 30px;
}

.hangman-player-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
}

.hangman-player-form input {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hangman-player-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.hangman-instructions {
    text-align: left;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.hangman-instructions h3 {
    margin-top: 0;
    color: #4a5568;
}

.hangman-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.hangman-instructions li {
    margin-bottom: 8px;
    color: #666;
}

/* Botones */
.hangman-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.hangman-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.hangman-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.hangman-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #cbd5e0;
}

.hangman-btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.hangman-btn-danger {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.hangman-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.6);
}

.hangman-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Pantalla del juego */
.hangman-game-screen {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hangman-game-header {
    margin-bottom: 30px;
}

.hangman-game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.hangman-player-info,
.hangman-timer,
.hangman-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #4a5568;
}

.hangman-timer-icon,
.hangman-score-icon {
    font-size: 1.2em;
}

.hangman-game-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Horca */
.hangman-gallows-container {
    text-align: center;
}

.hangman-gallows {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
}

.hangman-part {
    animation: drawPart 0.5s ease-in-out;
}

@keyframes drawPart {
    from {
        opacity: 0;
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        opacity: 1;
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.hangman-errors {
    font-size: 1.1em;
    font-weight: 600;
    color: #e53e3e;
}

/* Palabra y pista */
.hangman-word-container {
    text-align: center;
}

.hangman-hint {
    background: #fff5cd;
    border: 2px solid #f6e05e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hangman-hint-icon {
    font-size: 1.2em;
}

.hangman-word {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 0.2em;
    margin: 30px 0;
    color: #4a5568;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hangman-letter {
    display: inline-block;
    width: 50px;
    height: 60px;
    line-height: 60px;
    border-bottom: 4px solid #667eea;
    text-align: center;
    margin: 0 5px;
    position: relative;
    transition: all 0.3s ease;
}

.hangman-letter.revealed {
    animation: revealLetter 0.5s ease-in-out;
    color: #667eea;
}

@keyframes revealLetter {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Teclado virtual */
.hangman-keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.hangman-key {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hangman-key:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hangman-key.correct {
    background: #c6f6d5;
    border-color: #68d391;
    color: #22543d;
}

.hangman-key.incorrect {
    background: #fed7d7;
    border-color: #fc8181;
    color: #742a2a;
}

.hangman-key:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Acciones del juego */
.hangman-game-actions {
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Pantalla de resultado */
.hangman-result-screen {
    background: white;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hangman-result-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.hangman-result-content h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #4a5568;
}

.hangman-result-content p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.hangman-result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.hangman-stat {
    text-align: center;
}

.hangman-stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.hangman-stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #4a5568;
}

.hangman-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Clasificación */
.hangman-leaderboard-section {
    margin-top: 40px;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hangman-leaderboard-section h3 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #4a5568;
}

.hangman-leaderboard {
    margin-bottom: 20px;
}

.hangman-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hangman-leaderboard-table th,
.hangman-leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.hangman-leaderboard-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.hangman-leaderboard-table tr:hover {
    background: #f7fafc;
}

.hangman-leaderboard-table .position {
    font-weight: bold;
    color: #667eea;
    text-align: center;
    width: 60px;
}

.hangman-leaderboard-table .position.first {
    color: #f6ad55;
}

.hangman-leaderboard-table .position.second {
    color: #a0aec0;
}

.hangman-leaderboard-table .position.third {
    color: #cd7930;
}

.hangman-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.hangman-no-scores {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .hangman-game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .hangman-game-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hangman-game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .hangman-word {
        font-size: 2em;
        letter-spacing: 0.1em;
    }
    
    .hangman-letter {
        width: 40px;
        height: 50px;
        line-height: 50px;
        margin: 0 3px;
    }
    
    .hangman-keyboard {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        padding: 15px;
    }
    
    .hangman-key {
        padding: 10px 6px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .hangman-game-actions,
    .hangman-result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hangman-result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .hangman-leaderboard-table {
        font-size: 14px;
    }
    
    .hangman-leaderboard-table th,
    .hangman-leaderboard-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .hangman-welcome h2 {
        font-size: 2em;
    }
    
    .hangman-word {
        font-size: 1.5em;
    }
    
    .hangman-letter {
        width: 35px;
        height: 45px;
        line-height: 45px;
        margin: 0 2px;
    }
    
    .hangman-keyboard {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .hangman-result-stats {
        grid-template-columns: 1fr;
    }
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.hangman-btn-primary:active {
    animation: pulse 0.3s ease-in-out;
}

.hangman-game-container {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

