:root {
    --bg-color: #f4f4f9;
    --board-bg: #ffffff;
    --border-color: #333;
    --grid-line: #ccc;
    --highlight: #e2e7ed;
    --selected: #bbdefb;
    --text-color: #333;
}

body {
    font-family: sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 10px;
}

/* Ad Styling */
.ad-container {
    width: 100%;
    max-width: 728px;
    margin: 10px 0;
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    height: 90px;
    background-color: #ddd;
    border: 1px dashed #999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

/* Game Controls */
header {
    text-align: center;
    margin-bottom: 20px;
}

.controls button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.controls button:hover {
    background: #0056b3;
}

/* The Sudoku Board */
#game-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    background: var(--border-color);
    gap: 1px;
    border: 2px solid var(--border-color);
}

.tile {
    background-color: var(--board-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

/* Create the 3x3 Grid Visuals */
.tile:nth-child(3n) {
    border-right: 2px solid var(--border-color);
}
.tile:nth-child(9n) {
    border-right: none;
}
.tile:nth-child(n+19):nth-child(-n+27),
.tile:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--border-color);
}

/* Interaction States */
.tile.selected {
    background-color: var(--selected);
}

.tile.fixed {
    color: #000;
}

.tile.user-input {
    color: #007bff;
}

.tile.error {
    background-color: #ffcdd2;
    color: #d32f2f;
}

/* Numpad */
.numpad {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 300px;
}

.numpad button {
    padding: 15px;
    font-size: 18px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.numpad .delete-btn {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Modal (Hidden by default) */
.modal {
    display: none; /* Hidden */
    position: fixed; 
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 80%;
    max-width: 300px;
}

.modal-content h2 {
    color: #28a745; /* Green color for success */
    margin-top: 0;
}

.modal-content button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}