* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

h1 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn {
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn.easy {
    background-color: #dcfce7;
    color: #166534;
}

.btn.easy:hover {
    background-color: #bbf7d0;
}

.btn.medium {
    background-color: #fef9c3;
    color: #854d0e;
}

.btn.medium:hover {
    background-color: #fef08a;
}

.btn.hard {
    background-color: #fee2e2;
    color: #991b1b;
}

.btn.hard:hover {
    background-color: #fecaca;
}

.hidden {
    display: none !important;
}

#board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: #1f2937;
    border: 2px solid #1f2937;
    margin: 1rem 0;
    position: relative;
}

.cell {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    text-align: center;
    font-size: 1.25rem;
    background: white;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.cell.original {
    background-color: #f3f4f6;
    font-weight: bold;
    cursor: not-allowed;
}

.cell.selected {
    background-color: #dbeafe !important;
}

.cell.highlighted {
    background-color: #f8fafc;
}

.cell.same-number {
    background-color: #e0f2fe;
}

.cell.invalid {
    background-color: #fee2e2;
}

/* Dark borders for 3x3 boxes */
.cell:nth-child(3n) {
    border-right: 2px solid #1f2937;
}

.cell:nth-child(9n) {
    border-right: none;
}

.row-divider {
    border-bottom: 2px solid #1f2937;
}

/* Hint overlay */
.cell.hint::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(239, 68, 68, 0.1);
    pointer-events: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-back {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

#number-pad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

#number-pad button {
    background-color: #dbeafe;
    border: none;
    border-radius: 0.25rem;
    padding: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#number-pad button:hover {
    background-color: #bfdbfe;
}

.btn-erase {
    width: 100%;
    padding: 0.75rem;
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.btn-erase:hover {
    background-color: #e5e7eb;
}