/* sudokuJS v0.4.4 - CSS
// https://github.com/pocketjoso/sudokuJS
// Author: Jonas Ohlsson
// https://github.com/keplerg/sudoku
// Modified: Kepler Gelotte
// License: MIT
*/

.sudoku-board {
    position: relative;
    width: 100%;
    min-height: 22.75rem;
    margin-bottom: 1em;
}

#winner {
    display: none;
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    color: red;
    font-size: 10rem;
    font-weight: bold;
    font-style: italic;
    padding: 50px 0;
    text-align: center;
    // border: solid 5px #000;
    // border-radius: 20px;
    z-index: 100;
}

#board-error {
    color: red;
}

* {
    margin: 0; padding: 0;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
.wrap {
    padding: 2em 1em;
    width: 400px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media(min-width: 800px){
    .wrap {
        width: 800px;
    }
    .sudoku-board input {
        font-size: 24px;
        font-size: 1.5rem;
    }
    .sudoku-board .candidates {
        font-size: .8em;
    }
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

button {
    padding: 5px;
    margin: 5px;
}

/*cell (wrapper) contains both cell input and candidates div*/
.sudoku-board-cell {
    display: inline-block;
    position: relative;
    border: 1px solid #ddd;
    background: white;
    width: 11.11111%;
    aspect-ratio: 1/1;
}
/*rules for drawing the black lines dividing houses
    -- specific for board size 9! need diff rules for diff board sizes
*/
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(9n+1){
    border-left-width: 2px;
    border-left-color: #808080;
}
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(n):nth-of-type(-n+9){
    border-top-width: 2px;
    border-top-color: #808080;
}
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(3n){
    border-right-width: 2px;
    border-right-color: #808080;
}
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(n+19):nth-of-type(-n+27),
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(n+46):nth-of-type(-n+54),
[data-board-size="9"].sudoku-board .sudoku-board-cell:nth-of-type(n+73):nth-of-type(-n+81){
    border-bottom-width: 2px;
    border-bottom-color: #808080;
}

/* the input for the value of each cell (i.e. 1-9 or empty for standard sudoku*/
.sudoku-board-cell input {
    background: none;
    font-size: 2em;
    font-weight: bold;
    line-height: 2em;
    text-align: center;
    color: #00d;
    width: 100%;
    aspect-ratio: 1/1;
    border: 0;
    position: relative;
    z-index: 1; /*on top of candidates*/
}

.sudoku-board-cell input:disabled {
    color: #000;
    background: #f9f9f9;
    outline: none;
}

/*highlight new input in board cell*/
.sudoku-board-cell .highlight-val {
    outline: #00d;
}
/*highligt incorrect input*/
.sudoku-board-cell .board-cell-error {
    background: #fdd !important;
}

/*wrapper that hold the candidates for each cell*/
.sudoku-board-cell .candidates {
    display: none; /*hidden by default*/
    position: absolute;
    top: 0; left: 0;
    text-align: center;
    font-size: .9em; /*1/3 /1.13 out of the 2*1.2em cell height*/
    line-height: .75em;
    letter-spacing: -5px;
    font-family: monospace, sans-serif;
    text-align: left;
}
.sudoku-board .candidates:after {
    content: "";
    display: inline-block;
    width: 100%;
}

/* when board cells start to get narrower because of small screen,
    reduce letter spacing for candidates to make them still fit*/
@media(max-width: 23em){
    .sudoku-board .candidates {
        letter-spacing: -2px;
    }
}
.showCandidates .candidates {
    display: block;
}

/*each candidate in each cell is wrapped in a div*/
.sudoku-board .candidates span {
    display: inline-block;
    color: chocolate;
    width: auto;
    line-height: 1em;
    vertical-align: top;
    padding: .3em;
    *display: inline;
    *zoom: 1;
}
/*.candidates div*/.candidate-highlight {
    background-color: yellow;
}
/*.candidates div*/.candidate-to-remove {
    background-color: red;
    color: white;
}
