body {
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    margin: 0;
}

h2 {
    padding-right: 30px;
}

h3 {
    margin: 8px 0;
}

li {
    margin-top: 5px;
}

li li {
    font-size: 85%;
}

dialog {
    border: none;
    box-shadow: 0 0 16px gray;
    border-radius: 20px;
    max-width: calc(min(calc(.9 * 840px), 90vw));
    max-height: 85vh;
    padding: 0;
}

dialog>div {
    padding: 0 20px 5px 20px;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.2);
}

#options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

@media (max-width: 840px) {
    #options {
        grid-template-columns: 1fr;
    }
}

label {
    -webkit-user-select: none;
    user-select: none;
}

button.close-dialog {
    position: absolute;
    width: 28px;
    height: 28px;
    top: 15px;
    right: 15px;
    border-radius: 14px;
    line-height: 28px;
    font-size: 20px;
    border: none;
    padding: 0;
    background-color: #e9e9eb;
    transition: 0.1s;
}

button.close-dialog:hover {
    background-color: #ddd;
}

#board {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 128px);
    overflow: auto;
    margin: 0;
    padding: 0 16px 16px 16px;
    box-sizing: border-box;
}

table {
    margin: auto;
    border-collapse: collapse;
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

#buttons,
#info {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    font-size: 16px;
    margin: 8px auto;
    width: min(100%, var(--board-width));
}

#buttons button {
    height: 28px;
}

.timer {
    padding: 1px 3px;
    border-radius: 3px;
    font-family: 'Menlo', 'Consolas', monospace;
}

table:not(.punish-guessing) {
    --shadow-red: 128;
}

table.autopilot {
    --shadow-green: 128;
}

table.mindless {
    --shadow-blue: 128;
}

table {
    box-shadow: 8px 8px 8px rgba(var(--shadow-red, 0), var(--shadow-green, 0), var(--shadow-blue, 0), 0.2);
}

.tile {
    height: 36px;
    width: 36px;
    min-height: 36px;
    min-width: 36px;
    line-height: 40px;
    text-align: center;
    border: 1px solid black;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    background-color: #eee;
}

table.controls-swapped .tile:not(.revealed, .flag-permanent) {
    background-color: #ddf;
}

.tile>div {
    max-width: 36px;
    max-height: 36px;
    overflow: hidden;
}

.hidden {
    display: none;
}

.bg-red {
    background-color: pink;
}

.bg-green {
    background-color: lightgreen;
}

.bg-blue {
    background-color: lightblue;
}

.bg-orange {
    background-color: #ffcc99;
}

.bg-yellow {
    background-color: #ffff99;
}

.text-faded {
    opacity: 0.5;
}

.text-red {
    color: red;
}

.revealed {
    background-color: #ccc;
}

.number-1 {
    color: blue;
}

.number-2 {
    color: green;
}

.number-3 {
    color: red;
}

.number-4 {
    color: purple;
}

.number-5 {
    color: maroon;
}

.number-6 {
    color: teal;
}

.number-7 {
    color: black;
}

.number-8 {
    color: gray;
}