* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #333;
}

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

.header h1 {
    color: rgb(0, 0, 0);
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.header p {
    color: rgba(0, 0, 0);
    font-size: 1.1rem;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 30px;
    max-width: 600px;
    width: 100%;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.difficulty-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.difficulty-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.difficulty-btn:hover {
    transform: translateY(-1px);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
    color: #495057;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    background: #333;
    border: 3px solid #333;
    border-radius: 10px;
    padding: 3px;
    margin: 0 auto 30px;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
}

.sudoku-cell {
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

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

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

.sudoku-cell.given {
    background: #e9ecef;
    color: #495057;
    font-weight: 700;
}

.sudoku-cell.selected {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.05);
}

.sudoku-cell.error {
    background: #ff6b6b;
    color: white;
    animation: shake 0.5s ease-in-out;
}

.sudoku-cell.hint {
    background: #51cf66;
    color: white;
}

.sudoku-cell:hover:not(.given) {
    background: #f8f9fa;
    transform: scale(1.02);
}

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

.number-btn {
    aspect-ratio: 1;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
}

.number-btn:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.number-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.status-message {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
}

.status-message.success {
    background: #d4edda;
    color: #155724;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .game-container {
        padding: 20px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}