body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: #222;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 800px;
}

h1 {
    margin-bottom: 20px;
    color: #00ff00;
}

.game-area {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 40px);
    grid-template-rows: repeat(9, 40px);
    gap: 1px;
    background: #666;
    border: 3px solid #fff;
    padding: 2px;
}

.cell {
    background: #fff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.cell.given {
    background: #e0e0e0;
    color: #000;
    cursor: default;
}

.cell.selected {
    background: #87ceeb;
}

.cell.error {
    background: #ffcccb;
}

.cell.highlight {
    background: #ffffcc;
}

.cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 2px solid #333;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #333;
}

.game-info {
    background: #333;
    padding: 20px;
    border-radius: 10px;
    min-width: 200px;
}

.timer, .difficulty {
    margin: 15px 0;
    font-size: 18px;
}

.difficulty label {
    display: block;
    margin-bottom: 5px;
    color: #00ff00;
    font-weight: bold;
}

.difficulty select {
    width: 100%;
    padding: 8px;
    font-size: 16px;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 5px;
}

.controls {
    margin-top: 20px;
    text-align: left;
}

.controls h3 {
    margin-bottom: 10px;
    color: #00ff00;
}

.controls p {
    margin: 5px 0;
    font-size: 14px;
}

.buttons {
    margin-top: 20px;
}

button {
    margin: 5px;
    padding: 10px 20px;
    font-size: 16px;
    background: #00ff00;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #00cc00;
}

button:disabled {
    background: #666;
    cursor: not-allowed;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 20px auto;
}

.number-btn, .erase-btn {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #444;
    color: white;
    border: 2px solid #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover, .erase-btn:hover {
    background: #555;
    border-color: #00ff00;
}

.number-btn:active, .erase-btn:active {
    transform: scale(0.95);
}

.erase-btn {
    background: #cc4444;
    border-color: #aa3333;
}

.erase-btn:hover {
    background: #dd5555;
    border-color: #ff6666;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .sudoku-grid {
        grid-template-columns: repeat(9, 35px);
        grid-template-rows: repeat(9, 35px);
    }
    
    .cell {
        font-size: 16px;
    }
    
    .game-info {
        width: 100%;
        max-width: 320px;
    }
    
    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        max-width: 320px;
    }
    
    .number-btn, .erase-btn {
        padding: 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sudoku-grid {
        grid-template-columns: repeat(9, 28px);
        grid-template-rows: repeat(9, 28px);
    }
    
    .cell {
        font-size: 12px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        max-width: 280px;
    }
    
    .number-btn, .erase-btn {
        padding: 10px;
        font-size: 14px;
    }
}