/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
    text-align: center;
}

.game-intro {
    margin-bottom: 30px;
    color: var(--text-light);
}

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

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background-color: white;
}

.timer-display {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
    min-width: 100px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-secondary.active {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-hover);
}

/* Sudoku Board */
.sudoku-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    border: 2px solid var(--secondary-color);
    background-color: var(--secondary-color);
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
}

.cell {
    background-color: white;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* Thicker borders for 3x3 blocks */
.cell:nth-child(3n) {
    border-right: 2px solid var(--secondary-color);
}

.cell:nth-child(9n) {
    border-right: none;
    /* Handled by container border */
}

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

/* Cell States */
.cell.fixed {
    background-color: #f0f0f0;
    color: var(--text-color);
    font-weight: 700;
}

.cell.selected {
    background-color: #ffcc80;
    /* Darker orange */
    border: 2px solid var(--primary-color);
    z-index: 10;
    /* Ensure border is visible */
}

.cell.highlighted {
    background-color: #bbdefb;
    /* Light blue for same number, distinct from green/orange */
}

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

.cell.same-group {
    background-color: #ffeed4;
    /* Highlight row/col/box */
}

/* Notes */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.note {
    font-size: 0.6rem;
    color: #757575;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

/* Numpad */
.numpad-container {
    width: 100%;
    max-width: 450px;
}

.numpad-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
}

.num-btn {
    aspect-ratio: 1;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.1s;
}

.num-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.num-btn:active {
    transform: translateY(0);
}

/* Game Message Overlay */
.game-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.game-message:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.message-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.game-message:not(.hidden) .message-content {
    transform: translateY(0);
}

.message-content h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.message-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .sudoku-board {
        max-width: 100%;
    }

    .cell {
        font-size: 1.2rem;
    }

    .numpad {
        grid-template-columns: repeat(5, 1fr);
    }

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