.criptograma-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
    font-family: Arial, sans-serif;
}

.criptograma-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.criptograma-title {
    font-size: 18px;
    font-weight: bold;
}

.criptograma-controls {
    display: flex;
    gap: 10px;
}

.criptograma-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.hint-btn {
    background-color: #ffd700;
    color: #333;
}

.hint-btn:hover {
    background-color: #ffed4e;
    transform: scale(1.1);
}

.solution-btn {
    background-color: #333;
    color: white;
}

.solution-btn:hover {
    background-color: #555;
    transform: scale(1.1);
}

.criptograma-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.criptograma-grid {
    display: grid;
    gap: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.criptograma-cell {
    position: relative;
    min-height: 50px;
    background-color: white;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.criptograma-cell.space {
    background-color: transparent;
}

.criptograma-cell.punctuation {
    background-color: #ddd;
}

.criptograma-number {
    font-size: 12px;
    color: #333;
    font-weight: bold;
    margin-bottom: 2px;
}

.criptograma-input {
    width: 100%;
    height: 30px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background: transparent;
    text-transform: uppercase;
}

.criptograma-input:focus {
    outline: 2px solid #ff6b9d;
    background-color: #fff3f8;
}

.criptograma-letter {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
}

.revealed-letter {
    background-color: #333 !important;
    color: white !important;
}

.hint-letter {
    background-color: #80FF80 !important;
}

.hint-text {
    color: red !important;
    font-weight: bold;
}

.error-input {
    background-color: #ffcccc !important;
    border: 2px solid #ff0000 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    background-color: #f44336;
    color: white;
}

.punctuation-char {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.score-display {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
}

.message-display {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
}

.success-message {
    background-color: #4caf50;
    color: white;
}

.info-message {
    background-color: #2196f3;
    color: white;
}

@media (max-width: 768px) {
    .criptograma-container {
        margin: 10px;
        padding: 15px;
    }
    
    .criptograma-grid {
        gap: 1px;
        padding: 10px;
    }
    
    .criptograma-cell {
        min-height: 40px;
    }
    
    .criptograma-input {
        height: 25px;
        font-size: 14px;
    }
    
    .criptograma-letter {
        font-size: 14px;
    }
}



/* Estilos para el pop-up de felicitación */
.criptograma-popup {
    display: none; /* Oculto por defecto */
    position: fixed; /* Posición fija en la pantalla */
    z-index: 1000; /* Por encima de todo lo demás */
    left: 0;
    top: 0;
    width: 100%; /* Ancho completo */
    height: 100%; /* Alto completo */
    overflow: auto; /* Habilitar scroll si es necesario */
    background-color: rgba(0,0,0,0.7); /* Fondo oscuro semi-transparente */
    /* display: flex; */ /* Eliminado para que display: none; funcione correctamente */
    align-items: center;
    justify-content: center;
}

.criptograma-popup-content {
    background-color: #fefefe;
    margin: auto; /* Centrar vertical y horizontalmente */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Ancho del contenido del pop-up */
    max-width: 500px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #333;
    font-size: 24px;
    font-weight: bold;
}

.criptograma-popup-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.criptograma-popup-close:hover,
.criptograma-popup-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}



/* Estilos para la tabla de clasificación */
.criptograma-leaderboard {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.criptograma-leaderboard h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.criptograma-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.criptograma-leaderboard-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.criptograma-leaderboard-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.criptograma-leaderboard-table tr:hover {
    background-color: #e9ecef;
}

.criptograma-leaderboard-table td:first-child {
    font-weight: bold;
    color: #ff6b9d;
}

@media (max-width: 768px) {
    .criptograma-leaderboard {
        margin: 10px;
        padding: 15px;
    }
    
    .criptograma-leaderboard-table {
        font-size: 14px;
    }
    
    .criptograma-leaderboard-table th,
    .criptograma-leaderboard-table td {
        padding: 8px 4px;
    }
}

