/* styles/sudoku.css */

/* Heredamos variables de game.css */

.sdk-main {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
    background: linear-gradient(135deg, var(--bg-main, #f8f9fa) 0%, #e6e9ef 100%);
    min-height: calc(100vh - 120px);
}

.sdk-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-secondary, #ffffff);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* HEADER */
.sdk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light, #eee);
    padding-bottom: 15px;
}

.sdk-info h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary);
}

.sdk-diff.badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.sdk-timer {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
}

/* TABLERO */
.sdk-board-wrapper {
    display: flex;
    justify-content: center;
}

.sdk-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    width: 100%;
    aspect-ratio: 1;
    max-width: 400px;
    border: 2px solid var(--primary);
    background: var(--primary);
    gap: 1px;
}

.sdk-cell {
    background: var(--cell-bg, #fff);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent);
    /* Color usuario */
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Números Fijos (Pistas) */
.sdk-cell.fixed {
    color: var(--primary);
    font-weight: 800;
    background-color: #f1f5f9;
    /* Gris muy clarito */
}

/* Modo Oscuro ajuste */
body.dark-mode .sdk-cell.fixed {
    background-color: #374151;
    color: #fff;
}

/* Selección */
.sdk-cell.selected {
    background-color: var(--input-focus, #bbdefb) !important;
}

.sdk-cell.highlight-num {
    background-color: #e2e8f0;
}

body.dark-mode .sdk-cell.highlight-num {
    background-color: #4b5563;
}

.sdk-cell.error {
    background-color: #fecaca !important;
    color: #b91c1c !important;
}

/* BORDES GRUESOS (La clave del Sudoku visual) */
/* Borde derecho cada 3 columnas */
.sdk-cell:nth-child(3n) {
    border-right: 2px solid var(--primary);
}

/* Quitar borde derecho a la última columna para no duplicar borde contenedor */
.sdk-cell:nth-child(9n) {
    border-right: none;
}

/* Borde inferior cada 27 celdas (3 filas x 9 cols) */
/* Truco: Aplicamos margen inferior a las celdas de las filas 3 y 6 */
.sdk-cell:nth-child(n+19):nth-child(-n+27),
.sdk-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--primary);
}

/* CONTROLES */
.sdk-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sdk-numpad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
}

.num-btn {
    aspect-ratio: 1;
    border: 1px solid var(--border-light, #ccc);
    background: var(--bg-secondary);
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    transition: transform 0.1s;
}

.num-btn:active {
    transform: scale(0.9);
    background: var(--accent-light);
}

.sdk-actions {
    display: flex;
    gap: 10px;
}

.sdk-btn {
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
}

.sdk-btn.primary {
    background: var(--accent);
    color: white;
    flex: 2;
}

.sdk-btn.secondary {
    background: var(--border-light);
    color: var(--primary);
    font-size: 1.2rem;
}

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

.sdk-modal-content {
    background: var(--bg-secondary, #fff);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 350px;
    color: var(--primary);
}

.hidden {
    display: none !important;
}

/* Responsive móvil */
@media (max-width: 500px) {
    .sdk-container {
        padding: 15px;
        box-shadow: none;
        background: transparent;
    }

    .sdk-numpad {
        gap: 2px;
    }

    .num-btn {
        font-size: 1rem;
    }
}

/* styles/sudoku.css */

.sdk-main {
    display: flex;
    flex-direction: column;
    /* Apila el juego y el texto SEO uno debajo de otro */
    align-items: center;
    /* Centra horizontalmente */
    justify-content: flex-start;
    /* IMPORTANTE: Empieza desde arriba, no desde el centro */
    padding: 30px 10px;
    /* Un poco de aire arriba y abajo */
    background: linear-gradient(135deg, var(--bg-main, #f8f9fa) 0%, #e6e9ef 100%);
    min-height: 100vh;
    /* Ocupa al menos toda la pantalla */
    /* Quitamos el height: calc(...) fijo para permitir scroll */
}

/* Asegúrate de que el contenedor del juego tenga un margen abajo para separarlo del SEO */
.sdk-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-secondary, #ffffff);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    margin-bottom: 40px;
    /* Separación con el texto de abajo */
}
/* Para Chrome, Safari y Opera */
.sdk-main::-webkit-scrollbar {
    display: none;
}

/* Para Firefox, IE y Edge */
.sdk-main {
    -ms-overflow-style: none;
    /* IE y Edge */
    scrollbar-width: none;
    /* Firefox */
}