* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 40px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.difficulty-selector select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-hint {
    background: #ffc107;
    color: #333;
}

.btn-clear {
    background: #dc3545;
    color: white;
}

.timer {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

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

.cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cell:hover {
    background: #f0f8ff;
}

.cell.selected {
    background: #667eea;
    color: white;
}

.cell.given {
    background: #f8f9fa;
    color: #333;
    font-weight: 700;
}

.cell.error {
    background: #ffebee;
    color: #d32f2f;
}

.cell.hint {
    background: #fff3e0;
    color: #f57c00;
}

/* 3x3 box borders */
.cell:nth-child(3n) {
    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;
}

.number-pad {
    display: flex;
    justify-content: center;
}

.numbers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 300px;
}

.number-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.number-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.number-btn.erase {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.content-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.content-section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.content-section p {
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

.content-section ul {
    margin: 20px 0;
    padding-left: 30px;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.tips {
    display: grid;
    gap: 30px;
    margin-top: 30px;
}

.tip {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.tip h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.about-section, .how-to-play, .tips-section {
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .sudoku-board {
        max-width: 320px;
    }
    
    .cell {
        font-size: 16px;
    }
    
    .numbers {
        grid-template-columns: repeat(5, 1fr);
        max-width: 250px;
    }
    
    .number-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sudoku-board {
        max-width: 280px;
    }
    
    .cell {
        font-size: 14px;
    }
    
    .content-section {
        padding: 20px;
    }
}