/* Estilos generales del cuerpo de la página */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Estilos para el título principal */
h1 {
    color: white;
    text-align: center;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

/* Estilos de texto estándar y reglas */
p, .rules p {
    color: white;
    text-align: center;
    margin: 5px 0;
}

/* Estilos para subtítulos */
h2 {
    color: white;
    text-align: center;
    margin-top: 30px;
}

/* --- ESTILOS DEL ANOTADOR DE AYUDA --- */
.helper-board {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    text-align: center;
}

.helper-board h3 {
    color: white;
    margin-top: 0;
}

.helper-board p {
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Contenedor de botones de dígitos (0 al 9) */
.helper-digits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* Estilos base para los botones de dígitos de ayuda */
.helper-digits button {
    width: 45px;
    height: 45px;
    padding: 0;
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    background: #ffffff; /* Color neutro/blanco por defecto */
    color: #333;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.2s;
}

/* Estado: Dígito marcado como Malo */
.helper-digits button.bad {
    background: #f44336; 
    color: white;
    border-color: #d32f2f;
}

/* Estado: Dígito marcado como Regular */
.helper-digits button.regular {
    background: #ffeb3b; 
    color: #333;
    border-color: #fbc02d;
}

/* Contenedor e inputs para anotar los dígitos Buenos descubiertos */
.helper-good {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.helper-good input.good-input {
    width: 45px;
    height: 45px;
    padding: 0;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    border: 2px solid white;
}

.helper-good input.good-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* --- ESTILOS DE CONTROLES DEL JUEGO --- */
.game-controls {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

/* Estilos de los botones principales del juego */
button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Estilos para el input de prueba del código */
#miInput {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    width: 150px;
    margin: 10px;
}

#miInput:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

/* --- ESTILOS DEL CONTENEDOR DE RESULTADOS --- */
#resultado {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f0f0f0;
    box-sizing: border-box;
}

/* Estilos del scroll para navegadores WebKit */
#resultado::-webkit-scrollbar { width: 8px; }
#resultado::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 4px; }
#resultado::-webkit-scrollbar-thumb { background: #4CAF50; border-radius: 4px; }
#resultado::-webkit-scrollbar-thumb:hover { background: #45a049; }

/* Estilos de cada párrafo (intento) dentro del resultado */
#resultado p {
    color: #333;
    text-align: left;
    margin: 8px 0;
    padding: 8px;
    border-left: 4px solid #4CAF50;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Estilos para mensajes de error en el resultado */
#resultado p[style*="color : red"] {
    border-left-color: #f44336;
    background: #ffeaea;
}

/* Estilos para mensajes de éxito en el resultado */
#resultado p[style*="color : green"] {
    border-left-color: #4CAF50;
    background: #e8f5e8;
}

/* --- DISEÑO RESPONSIVO (MOBILE) --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    /* Ajustes para botones de ayuda en pantallas pequeñas */
    .helper-digits button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .helper-good input.good-input {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    /* Botones e inputs de juego a pantalla completa en móviles */
    .game-controls button, #miInput {
        width: calc(100% - 20px);
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* El anotador y el resultado ocupan todo el ancho */
    .helper-board, #resultado {
        padding: 15px 10px;
    }
}