/* Samurai Sudoku — 21×21 board with 5 overlapping 9×9 grids */

.samurai-grid {
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    grid-template-rows: repeat(21, 1fr);
    width: min(96vw, 720px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background: var(--bg, #fff);
    gap: 0;
    user-select: none;
}

.s-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cell-bg, #fff);
    border: 1px solid var(--border-soft, #d4d4d8);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(0.55rem, 1.2vw, 1rem);
    color: var(--fg, #18181b);
    cursor: pointer;
    transition: background 0.12s ease;
    box-sizing: border-box;
}

.s-cell.inactive {
    visibility: hidden;
    pointer-events: none;
    background: transparent;
    border: none;
}

.s-cell:hover:not(.inactive) {
    background: var(--cell-hover, #fef3c7);
}

.s-cell.given {
    color: var(--fg, #18181b);
    font-weight: 700;
}

.s-cell.user {
    color: var(--accent, #c2410c);
    font-weight: 600;
}

.s-cell.solver-fill {
    color: var(--success, #16a34a);
    font-weight: 600;
}

.s-cell.selected {
    background: var(--accent-soft, #fed7aa) !important;
    outline: 2px solid var(--accent, #c2410c);
    outline-offset: -2px;
    z-index: 2;
}

.s-cell.highlighted {
    background: var(--highlight, #fef3c7);
}

.s-cell.same-number {
    background: var(--same-num, #fde68a);
}

.s-cell.error-cell {
    background: var(--error-bg, #fecaca) !important;
    color: var(--error, #dc2626) !important;
}

/* 3×3 box borders inside each sub-grid */
.s-cell.box-right  { border-right: 2px solid var(--fg, #18181b); }
.s-cell.box-bottom { border-bottom: 2px solid var(--fg, #18181b); }
.s-cell.box-left   { border-left: 2px solid var(--fg, #18181b); }
.s-cell.box-top    { border-top: 2px solid var(--fg, #18181b); }

/* Outer perimeter borders for each of the 5 sub-grids */
.s-cell.grid-right  { border-right: 3px solid var(--fg, #18181b); }
.s-cell.grid-bottom { border-bottom: 3px solid var(--fg, #18181b); }
.s-cell.grid-left   { border-left: 3px solid var(--fg, #18181b); }
.s-cell.grid-top    { border-top: 3px solid var(--fg, #18181b); }

@media (max-width: 480px) {
    .samurai-grid {
        width: min(98vw, 420px);
        font-size: 0.5rem;
    }
    .s-cell {
        font-size: 0.55rem;
    }
}
