.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.controls select {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
}

.controls select:hover {
    border-color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

.controls select option {
    background: #111;
    color: #fff;
}

.stats {
    font-size: 1.2rem;
    color: #00ffcc;
    font-weight: bold;
}

.sudoku-board {
    display: grid;
    gap: 1px;
    background: #444; /* Lines between cells */
    border: 3px solid #00ffcc;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1; /* Ensures perfect square layout overall */
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

.sudoku-cell {
    background: #1a1a1a;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    aspect-ratio: 1; 
}

/* Modifiers for thick block borders set dynamically by JS */
.border-right {
    border-right: 3px solid #00ffcc !important;
}
.border-bottom {
    border-bottom: 3px solid #00ffcc !important;
}

.sudoku-cell.fixed {
    color: #ccc;
    font-weight: normal;
}

.sudoku-cell.user-input {
    color: #00ffcc;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

.sudoku-cell:hover {
    background: #2a2a2a;
}

.sudoku-cell.selected {
    background: #00ffcc !important;
    color: #111 !important;
    font-weight: bold;
    transform: scale(0.90);
    border-radius: 8px;
    box-shadow: 0 0 12px #00ffcc;
    z-index: 2;
}

.sudoku-cell.highlight-group {
    background: #2a3835 !important;
}

.sudoku-cell.highlight-number {
    background: #1a4a42 !important;
    color: #00ffcc;
}
.sudoku-cell.fixed.highlight-number {
    color: #fff;
}

.sudoku-cell.wrong-move {
    color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.15) !important;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.sudoku-cell.error {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.2) !important;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 25px;
    width: 100%;
}

.numpad-btn {
    position: relative;
    width: 100%;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: #00ffcc;
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.numpad-count {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 0.70rem;
    color: rgba(0, 255, 204, 0.75);
    font-weight: bold;
}

.numpad-btn:hover, .numpad-btn:active {
    background: #00ffcc;
    color: #111;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
}

.tools {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 20px;
    gap: 8px;
    width: 100%;
}

.tool-btn {
    background: rgba(0, 255, 204, 0.1);
    color: #00ffcc;
    border: 1px solid #00ffcc;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.tool-btn:hover {
    background: #00ffcc;
    color: #111;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
}

.tool-btn svg {
    width: 24px;
    height: 24px;
}

.animate-complete {
    animation: spinPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 10;
}

@keyframes spinPop {
    0% { 
        transform: scale(1) rotate(0deg); 
        background: rgba(0, 255, 204, 0.5); 
    }
    50% { 
        transform: scale(1.2) rotate(180deg); 
        box-shadow: 0 0 25px #00ffcc; 
        background: #00ffcc; 
        color: #111; 
        border-radius: 12px;
    }
    100% { 
        transform: scale(1) rotate(360deg); 
        background: #1a1a1a; 
    }
}

@media screen and (max-width: 480px) {
    .sudoku-cell {
        font-size: 1.4rem;
    }
    .numpad-btn {
        height: 40px;
        font-size: 1.2rem;
    }
    .tool-btn {
        font-size: 0.65rem;
        padding: 8px 2px;
    }
    .tool-btn svg {
        width: 20px;
        height: 20px;
    }
}

.ghost-number {
    color: rgba(255, 255, 255, 0.2) !important;
    font-size: 1.3rem;
    font-style: italic;
    font-weight: 300;
}

.dev-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dev-toggle-btn:hover {
    border-color: rgba(0, 255, 204, 0.4);
    color: #ddd;
}

.dev-toggle-btn.active {
    border-color: #00ffcc;
    color: #00ffcc;
    background: rgba(0, 255, 204, 0.1);
}

.dev-toggle-btn svg {
    width: 18px;
    height: 18px;
}
