.sudoku-page {
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: none;
}

/* Override Tailwind preflight resets for the site header on game pages */
.sudoku-page .site-header .header-inner {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sudoku-page .site-header .site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.sudoku-page .site-header .site-nav a {
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.5rem; /* Increased hit area for mobile */
    display: inline-flex;
    align-items: center;
}

.sudoku-page .site-header .masthead-logo img {
    height: 28px;
    width: auto;
    display: block;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    aspect-ratio: 1;
}

.sudoku-cell {
    border-right: 1px solid var(--color-outline-variant);
    border-bottom: 1px solid var(--color-outline-variant);
    background: var(--color-surface-container-lowest);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headline);
    font-size: clamp(1.2rem, 4vw, 2rem);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease;
}

/* Thicker borders for 3x3 blocks */
.sudoku-cell:nth-child(3n) { border-right: 2px solid var(--color-on-background); }
.sudoku-cell:nth-child(9n) { border-right: none; }
.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--color-on-background);
}
.sudoku-cell:nth-child(n+73) { border-bottom: none; }

/* States */
.sudoku-cell.given {
    font-weight: 700;
    color: var(--color-on-background);
    cursor: default;
}

.sudoku-cell.user-input {
    font-weight: 400;
    color: var(--color-primary);
}

.sudoku-cell.selected {
    background: var(--color-tertiary-container);
    color: var(--color-on-tertiary-container);
}

.sudoku-cell.highlight-num {
    background: var(--color-surface-container);
}

.sudoku-cell.error {
    color: var(--color-error);
    background: var(--color-error-container);
}

/* Numpad */
.sudoku-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.sdk-pad-btn {
    background: var(--color-surface-container);
    border: 1px solid var(--color-outline-variant);
    padding: 1rem 0;
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-on-surface);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sdk-pad-btn:hover {
    background: var(--color-surface-variant);
}

.sdk-pad-btn:active {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.sdk-pad-btn.action-clear {
    width: 100%;
    margin-top: 0.5rem;
    font-family: var(--font-label);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
