* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    color: #333;
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 25px;
    margin-top: 20px;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.difficulty {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.difficulty-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background: #3498db;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-btn.active {
    background: #2c3e50;
    transform: scale(1.05);
}

.difficulty-btn:hover {
    background: #2980b9;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    margin: 20px 0;
    border: 3px solid #2c3e50;
    background: #2c3e50;
    border-radius: 5px;
    overflow: hidden;
}

.cell {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

@media (max-width: 600px) {
    .cell {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

.cell:hover {
    background: #f1f1f1;
}

.cell.selected {
    background: #aed6f1;
}

.cell.fixed {
    color: #2c3e50;
    font-weight: bold;
}

.cell.error {
    background: #f8d7da;
    color: #721c24;
}

.border-right-3 {
    border-right: 3px solid #2c3e50;
}

.border-bottom-3 {
    border-bottom: 3px solid #2c3e50;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.number-controls {
    display: flex;
    gap: 5px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.number-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #3498db;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover {
    background: #3498db;
    color: white;
}

.timer {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 15px 0;
    color: #2c3e50;
}

.message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.instructions {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.instructions ul {
    margin-left: 20px;
    line-height: 1.6;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: white;
    font-size: 0.9rem;
}
