/**
* Wordfind.js 0.0.1
* (c) 2012 Bill, BunKat LLC.
* Wordfind is freely distributable under the MIT license.
* For all details and documentation:
*     http://github.com/bunkat/wordfind
*/

#main {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    text-align: center; /* to center #puzzle on small devices */
}

.count-container {
    margin: 7px 0 5px 20px;
}

.count-container p {
    display: inline;
    padding: 0 15px;
}

.count-container span {
    font-weight: bold;
}

/**
* Styles for the puzzle
*/
.puzzle-container {
    overflow-x: auto;
}

#puzzle {
    padding: 0;
    display: grid;
}

#puzzle > div { /* rows */
    display: contents;
}

/* style for each square in the puzzle */
.puzzleSquare {
    text-transform: uppercase;
    background-color: white;
    border: 1px solid gray;
    font-size: 1.9rem;
    padding: 0.2rem;

}

/* Styles for the word list*/
.words-container {
    overflow: auto;
}

#words {
    display: flex;
    gap: .4rem .5rem;
    flex-wrap: wrap;
    padding: .5rem;
    overflow: auto;
    list-style-type: none;
}

#words li {
    border: 1px solid #E6E6E6;
    border-radius: 5px;
}

#words li p {
    padding: .2rem .25rem;
    text-transform: uppercase;
}

#words p.wordFound {
    text-decoration: line-through;
}

button::-moz-focus-inner {
    border: 0;
}


/* indicates that the square is part of a word that has been found */
#puzzle .found {
    background-color: #dbeadf;
}

/* indicates when a square has been selected */
#puzzle .selected {
    background-color: orange;
}

#puzzle .solved {
    background-color: purple;
    color: white;
}

/* indicates that all words have been found */
#puzzle .complete {
    background-color: #dbeadf;
}

/* indicates that the word has been found */
.wordFound {
    color: gray;
    background-color: #dbeadf;
}

/**
* Styles for the controls
*/
#controls {
    display: inline-block;
    max-width: 30rem;
    padding: 1em;
    border: none;
    text-align: left;
}

label {
    white-space: nowrap;
    margin-top: 1em;
}

input {
    border: none;
    border-bottom: 1px solid #ccc;
    font-size: 1em;
}

input[type="number"] {
    width: 2rem;
}

select {
    max-width: 10rem;
}

#create-grid, #solve {
    display: block;
    margin-top: 1rem;
}

#secret-word {
    text-transform: uppercase;
}

#result-message {
    font-size: 1.2em;
}

@media only screen and (min-width: 870px) {
    #puzzle {
        padding: 0.5rem;
    }

    .puzzleSquare {
        padding: 0.3rem 0;
    }

    #main {
        text-align: left;
        flex-wrap: nowrap;
    }

    .puzzle-container {
        flex-basis: 56vw;
    }

    .words-container {
        flex-basis: 40vw;
    }

}

@media (max-width: 1279.98px) {
    .puzzleSquare {
        font-size: 1.5rem;
    }
}

@media (max-width: 869px) {
    .count-container p {
        display: inline;
        padding: 0 10px;
    }

    .count-container p:first-child {
        padding-left: 15px;
    }

    .puzzle-container {
        width: 100%;
    }

    #puzzle {
        padding: 0;
    }

    .puzzleSquare {
        font-size: 1rem;
        padding: 0.04rem 0;
    }

    #words {
        overflow: auto;
        flex-wrap: nowrap;
        gap: 0.4rem 0.7rem;
    }

    #words li p {
        font-size: 0.8rem;
    }
}

@media (max-width: 460px) {
    .count-container {
        margin: 7px 0 5px 5px;
    }

    .puzzleSquare {
        font-size: .85rem;
    }

    #puzzle {
        padding: 0;
    }
}
