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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

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

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

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

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-selector select {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.difficulty-selector select:hover {
    border-color: #764ba2;
}

.game-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.game-controls button:active {
    transform: translateY(0);
}

.game-info {
    display: flex;
    justify-content: space-around;
    font-size: 16px;
    color: #555;
    font-weight: bold;
}

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

.cell {
    background: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

.cell:hover:not(.fixed) {
    background-color: #f0f8ff;
}

.cell.selected {
    background-color: #e6f3ff !important;
}

.cell.fixed {
    background-color: #f8f8f8;
    color: #333;
    cursor: default;
    font-weight: bold;
}

.cell.highlight {
    background-color: #fffacd;
}

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

.cell.success {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.cell.hint {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.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: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 30px auto;
}

.number-pad button {
    padding: 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.number-pad button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.number-pad button.erase {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.number-pad button.erase:hover {
    background: #ff5252;
}

.message {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    min-height: 20px;
    transition: all 0.3s;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.message.error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #d32f2f;
}

.message.info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #1976d2;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

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

    .game-controls button {
        width: 100%;
    }

    .cell {
        font-size: 16px;
    }

    .number-pad {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .number-pad button {
        padding: 15px;
        font-size: 16px;
    }
}