/* Apply base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.6;
    background-color: #f6f8fa; /* Light background */
    margin: 0;
    padding: 0;
}

.container {
    max-width: 980px; /* Consistent width */
    margin: 20px auto;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content within container */
}

h1 {
    text-align: center;
    color: #24292e; /* GitHub-like heading color */
    margin-top: 0; /* Remove default margin if container adds padding */
    margin-bottom: 20px; /* Keep some space below heading */
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
    width: 100%; /* Make border span container width */
}

#sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 40px);
    grid-template-rows: repeat(9, 40px);
    border: 2px solid black;
    margin-bottom: 20px;
    /* Adjust size slightly if needed */
    /* width: 364px; */ /* 9 * 40 + 2 * 2 border */
    /* height: 364px; */
}

.cell {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-sizing: border-box; /* Include border in size */
    background-color: #fff; /* Ensure cells are white */
    color: #333; /* Default text color */
}

/* Add thicker borders for 3x3 subgrids */
.cell:nth-child(3n):not(:nth-child(9n)) { /* Exclude the last column */
    border-right: 2px solid black;
}

/* Select rows - need to adjust selectors based on grid structure */
/* Rows 3 and 6 need thicker bottom borders */
#sudoku-board > .cell:nth-child(n+19):nth-child(-n+27),
#sudoku-board > .cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid black;
}


button#generate-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #0366d6; /* GitHub blue */
    color: white;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin-bottom: 20px; /* Space before back link */
}

button#generate-btn:hover {
    background-color: #005cc5; /* Darker blue on hover */
}

/* Back link styles */
.back-link {
    text-align: center;
    margin-top: 20px; /* Adjusted margin */
    padding-top: 20px;
    border-top: 1px solid #eaecef;
    width: 100%; /* Span container width */
}

.back-link a {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}