/* Game Section Styles */
.game-section {
    padding: 2rem;
    background-color: var(--light-color);
    min-height: calc(100vh - 150px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-container {
    max-width: 1000px;
    width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
}

.game-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-selector label {
    font-weight: 600;
    color: var(--dark-color);
}

.difficulty-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    background-color: white;
    font-size: 1rem;
    cursor: pointer;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.game-info > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 120px;
}

.game-info .label {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

#time-display, #moves-count, #mistakes-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Sudoku Grid Styles */
.sudoku-grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1px;
    background-color: var(--grid-color);
    padding: 3px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    aspect-ratio: 1;
}

.sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    position: relative;
}

.sudoku-cell:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

.sudoku-cell.selected {
    background-color: rgba(74, 111, 165, 0.2);
    border: 2px solid var(--primary-color);
    z-index: 1;
}

.sudoku-cell.pre-filled {
    color: var(--dark-color);
    background-color: #f8f9fa;
    font-weight: bold;
}

.sudoku-cell.user-filled {
    color: var(--primary-color);
}

.sudoku-cell.hint {
    background-color: rgba(255, 209, 102, 0.3);
    animation: pulse 1s ease-in-out;
}

.sudoku-cell.error {
    background-color: rgba(255, 107, 107, 0.3);
    animation: shake 0.5s ease-in-out;
}

.sudoku-cell.correct {
    background-color: rgba(72, 187, 120, 0.3);
}

/* Grid borders for 3x3 subgrids */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid var(--grid-color);
}

.sudoku-cell:nth-child(9n) {
    border-right: none;
}

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

/* Number Pad Styles */
.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    justify-items: center;
}

.number-btn {
    width: 50px;
    height: 50px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.number-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.number-btn.selected {
    background-color: var(--primary-color);
    color: white;
}

#clear-btn, #delete-btn {
    grid-column: span 5;
    width: 100%;
    max-width: 200px;
    margin-top: 10px;
}

#delete-btn {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#delete-btn:hover {
    background-color: #5a4cb3;
    border-color: #5a4cb3;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 20px rgba(106, 90, 205, 0.6);
}

/* Game Message Styles */
.game-message {
    text-align: center;
    margin-top: 2rem;
    min-height: 50px;
}

.game-message.success {
    color: #48bb78;
    font-size: 1.5rem;
    font-weight: bold;
    animation: fadeIn 1s ease-in-out;
}

.game-message.error {
    color: #f56565;
    font-size: 1.5rem;
    font-weight: bold;
    animation: fadeIn 1s ease-in-out;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Game Styles */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .sudoku-cell {
        font-size: 1.2rem;
    }
    
    .number-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .game-info {
        gap: 1rem;
    }
    
    .game-info > div {
        padding: 0.5rem 1rem;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .game-section {
        padding: 1rem;
    }
    
    .sudoku-cell {
        font-size: 1rem;
    }
    
    .game-header h2 {
        font-size: 2rem;
    }
}