body {
    margin: 0;
    background: #222;
    color: #dddddd;
    font-family: sans-serif;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: stretch;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

a, a:visited {
    color: white;
}

body.win {
    background: #030;
}

body.loose {
    background: #300;
}

nav {
    flex-basis: 13em;
    flex-grow: 0;
    flex-shrink: 0;
    text-align: center;
    line-height: 2em;
    font-size: 1.2em;
}

#solver-ctrl {
    margin: auto;
}

#timer, #bomb-count {
    font-size: 1.5em;
}

main {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    align-items: center;
}

#grid {
    border-spacing: 0;
}

#grid td, .solver-cell {
    border-radius: 3px;
    background: #444;
    width: 30px;
    height: 30px;
    text-align: center;
    cursor: default;
    border: solid 1px #222;
}

#grid td.clicked {
    background: #888;
}

#grid td.marked:not(.clicked), .solver-cell.marked {
    background: #444 url("img/flag.png") center/70% no-repeat;
}
#grid td:not(.clicked):hover {
    background-color: #666;
}

#grid td.clicked {
    background: #888;
}

#grid td.hint-clickable {
    border-color: #0F0;
}

#grid td.hint-markable {
    border-color: #F00;
}

#grid td.solver-highlight-neutral {
    border-color: #777;
}

#grid td.solver-highlight-safe {
    border-color: #7d7;
}

#grid td.solver-highlight-bomb {
    border-color: #d77;
}

#grid td.solver-highlight-safest {
    border-color: #7a7;
    background: #454;
    font-style: italic;
}

#grid td.solver-highlight-less-safest {
    border-color: #a77;
    background: #544;
    font-style: italic;
}

#grid td.solver-highlight-less-safest,
#grid td.solver-highlight-safest,
#grid td.solver-highlight-neutral {
    font-style: italic;
    font-size: .8em;
    color: #999;
}

#grid td.clicked.b1, .solver-cell.clicked.b1 { background: #292; }
#grid td.clicked.b2 { background: #382; }
#grid td.clicked.b3 { background: #472; }
#grid td.clicked.b4 { background: #562; }
#grid td.clicked.b5 { background: #652; }
#grid td.clicked.b6 { background: #742; }
#grid td.clicked.b7 { background: #832; }
#grid td.clicked.b8 { background: #922; }


#grid td.mine:not(.marked) {
    background: #444 url("img/mine.png") center/70% no-repeat;
}

body.loose #grid td.mine:not(.marked) {
    background-color: #a00;
}

input[type="number"] {
    width: 4em;
    background: #ddd;
    border: none;
    border-radius: 3px;
    padding-left: 10px;
    height: calc(12px + 1em);
    font-size: .8em;
}

input[type="checkbox"] {
    width: 1.5em;
    height: 1.5em;
}

button {
    background: #999999;
    border: none;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: .8em;
}
button:hover {
    background: #bbbbbb;
}
