/* ===== Estilos generales (tema oscuro arcade) ===== */

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
    margin: 0;
    padding: 20px;
    background: radial-gradient(circle at top, #283593 0, #0b1020 45%, #000000 100%);
    color: #f5f5f5;
    text-align: center;
}

/* Pequeño título tipo juego */
h2 {
    margin: 10px 0 5px 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
}

h3 {
    margin: 8px 0;
}

/* ===== Panel de configuración (estilo tarjeta de control) ===== */

#configuracion {
    margin: 10px auto 25px auto;
    padding: 12px 18px;
    max-width: 640px;
    background: rgba(15, 23, 42, 0.9); /* azul muy oscuro */
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
}

#configuracion label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

#configuracion input[type="number"] {
    width: 70px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #64748b;
    background-color: #020617;
    color: #e2e8f0;
    text-align: center;
}

#configuracion input[type="number"]:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e60;
}

/* Botón aplicar configuración estilo primario */

#btn-aplicar-config {
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid #22c55e;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #0b1120;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}

#btn-aplicar-config:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.85);
    transform: translateY(-1px);
}

#btn-aplicar-config:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* ===== Tablero del juego ===== */

#contenedor-tabla {
    display: inline-block;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 16px;
    background: radial-gradient(circle at top, #1e293b 0, #020617 70%);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(30, 64, 175, 0.6);
}

#contenedor-tabla table {
    border-collapse: collapse;
    margin: 0 auto;
}

#contenedor-tabla td {
    background-color: #020617; /* celda base oscura */
    border: 2px solid #1e293b;
    text-align: center;
    vertical-align: middle;
    border-radius: 10px;
    box-shadow: 0 0 0 1px #0f172a;
    color: #e5e7eb;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}

/* Efecto al rellenar celdas (cuando JS pone números) */
#contenedor-tabla td:not(:empty) {
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
}

/* ===== Panel de botones ===== */

#panel-botones {
    margin-top: 12px;
    margin-bottom: 12px;
}

.fila-botones {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

/* Estilo base para todos los botones */

button {
    padding: 9px 13px;
    margin: 0;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid #1e293b;
    cursor: pointer;
    background: #020617;
    color: #e5e7eb;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 600;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

button:hover:not(:disabled) {
    background-color: #111827;
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 0 4px rgba(15, 23, 42, 0.9);
}

button:disabled {
    background-color: #111827;
    border-color: #4b5563;
    color: #6b7280;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-num {
    width: 44px;
    padding-inline: 0;
    font-size: 0.85rem;
}

/* Botón borrar: estilo “alerta” */

#btn-borrar {
    background: linear-gradient(135deg, #b91c1c, #f97316);
    border-color: #fb923c;
    color: #fff7ed;
}

#btn-borrar:hover:not(:disabled) {
    box-shadow: 0 0 14px rgba(248, 113, 113, 0.9);
}

/* Botón enviar: estilo “acción principal” */

#btn-enviar {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #4ade80;
    color: #022c22;
    font-weight: 800;
}

#btn-enviar:hover:not(:disabled) {
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.95);
}

/* Botón reiniciar: estilo “info” */

#btn-reiniciar {
    background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
    border-color: #38bdf8;
    color: #e0f2fe;
}

#btn-reiniciar:hover:not(:disabled) {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.95);
}

/* ===== Información de intentos y mensajes ===== */

#intentos-restantes,
#intento-actual {
    margin: 5px 0;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #cbd5f5;
}

#mensaje {
    min-height: 1.5em;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    color: #e5e7eb;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.7);
}

#mostrar-secreto {
    margin-top: 5px;
    font-style: italic;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ===== Pequeño ajuste responsive ===== */

@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    #configuracion {
        max-width: 100%;
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    #contenedor-tabla {
        padding: 10px;
    }

    #contenedor-tabla td {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }

    button {
        font-size: 0.75rem;
        padding: 7px 9px;
    }

    .btn-num {
        width: 38px;
    }
}
