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

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

.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-home a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-home a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.game-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 700px;
    width: 100%;
}

.game-header h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffd89b, #19547b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 10px;
}

.info-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    flex: 1;
}

.info-label {
    display: block;
    color: #ccc;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffd89b;
}

.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 1rem;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.difficulty-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #ffd89b, #19547b);
    border-color: transparent;
}

.sudoku-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#sudokuBoard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #333;
    border: 3px solid #333;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin: 0 auto;
}

.sudoku-cell {
    width: 45px;
    height: 45px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    color: #333;
    transition: all 0.2s;
}

.sudoku-cell:hover:not(.initial) {
    background: #e3f2fd;
}

.sudoku-cell.selected {
    background: #bbdefb;
}

.sudoku-cell.initial {
    background: #f5f5f5;
    color: #000;
    cursor: default;
}

.sudoku-cell.incorrect {
    background: #ffcdd2;
    color: #c62828;
}

.sudoku-cell.border-top {
    border-top: 2px solid #333;
}

.sudoku-cell.border-left {
    border-left: 2px solid #333;
}

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

.number-btn {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #333;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.number-btn.erase-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border-color: transparent;
    font-size: 1.8rem;
}

.number-btn.erase-btn:hover {
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
}

.game-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

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

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

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

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

.instructions p {
    color: #ccc;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .sudoku-cell {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .game-info {
        flex-wrap: wrap;
    }

    .info-item {
        flex: 1 1 45%;
    }

    .difficulty-buttons {
        flex-direction: column;
    }

    .game-controls {
        grid-template-columns: 1fr;
    }

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

    .number-btn {
        padding: 10px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .sudoku-cell {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}
