/* Game Page Specific Styles */
:root {
    --cell-size: 60px;
    --border-light: #ddd;
    --border-medium: #999;
    --border-bold: #333;
    --cell-selected: rgba(78, 205, 196, 0.3);
    --cell-conflict: rgba(255, 107, 107, 0.3);
    --cell-highlight: rgba(255, 209, 102, 0.2);
    --given-number: #2A2D34;
    --user-number: #4ECDC4;
}

.game-main {
    padding: 40px 0;
}

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

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

.difficulty-selector label {
    font-weight: 600;
    margin-right: 10px;
}

.difficulty-selector select {
    padding: 8px 12px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-selector select:hover {
    border-color: var(--primary-color);
}

.timer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.timer-label {
    font-weight: 600;
}

#game-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

/* Sudoku Board Styles */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    gap: 0;
    border: 3px solid var(--border-bold);
    border-radius: 8px;
    padding: 5px;
    background-color: white;
    box-shadow: var(--box-shadow);
    position: relative;
}

.sudoku-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background-color: white;
    transition: var(--transition);
    position: relative;
}

/* Create 3x3 subgrid borders */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid var(--border-medium);
}

.sudoku-cell:nth-child(9n) {
    border-right: 1px solid var(--border-light);
}

.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(--border-medium);
}

/* Every 9th row reset bottom border */
.sudoku-cell:nth-child(n+73):nth-child(-n+81) {
    border-bottom: 1px solid var(--border-light);
}

/* Highlight 3x3 blocks with background */
.sudoku-cell:nth-child(n+1):nth-child(-n+9),
.sudoku-cell:nth-child(n+37):nth-child(-n+45),
.sudoku-cell:nth-child(n+73):nth-child(-n+81) {
    background-color: rgba(78, 205, 196, 0.05);
}

.sudoku-cell:nth-child(n+10):nth-child(-n+18),
.sudoku-cell:nth-child(n+46):nth-child(-n+54),
.sudoku-cell:nth-child(n+82):nth-child(-n+90) {
    background-color: rgba(255, 209, 102, 0.05);
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+55):nth-child(-n+63),
.sudoku-cell:nth-child(n+91):nth-child(-n+99) {
    background-color: rgba(78, 205, 196, 0.05);
}

/* Cell states */
.sudoku-cell.given {
    color: var(--given-number);
    font-weight: 700;
}

.sudoku-cell.user-input {
    color: var(--user-number);
}

.sudoku-cell:hover {
    background-color: rgba(78, 205, 196, 0.2);
}

.sudoku-cell.selected {
    background-color: var(--cell-selected);
    outline: 3px solid var(--secondary-color);
    z-index: 1;
}

.sudoku-cell.conflict {
    background-color: var(--cell-conflict);
}

.sudoku-cell.highlight {
    background-color: var(--cell-highlight);
}

/* Game Sidebar */
.game-sidebar {
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.number-pad {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.number-pad h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

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

.number-btn {
    padding: 15px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.number-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

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

/* Game Actions */
.game-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-actions button {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

/* Game Status */
.game-status {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Game Instructions */
.game-instructions {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.game-instructions h3 {
    margin-bottom: 15px;
}

.keyboard-shortcuts {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.keyboard-shortcuts ul {
    list-style-position: inside;
    margin-left: 20px;
}

.keyboard-shortcuts li {
    margin-bottom: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalFadeIn 0.3s ease;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-actions button {
    min-width: 120px;
}

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

/* Responsive Design for Game Page */
@media (max-width: 768px) {
    :root {
        --cell-size: 45px;
    }
    
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 20px;
    }
    
    .sudoku-board {
        border-width: 2px;
    }
    
    .sudoku-cell {
        font-size: 1.2rem;
    }
    
    .game-sidebar {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    :root {
        --cell-size: 35px;
    }
    
    .sudoku-cell {
        font-size: 1rem;
    }
    
    .number-btn {
        padding: 10px;
        font-size: 1rem;
    }
    
    .game-header h2 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}