body {
    font-family: "Fira Sans", sans-serif;
    font-weight: 400;
    font-style: normal;
    margin: 0;
}

.main {
    margin: auto;
    padding: 8px;

    display: grid;
    grid-template:
        "title"
        "game"
        "side"
        "explain";
    width: min-content;
}

@media only screen and (min-width: 640px) {
    .main {
        grid-template:
            "title title" auto
            "game side" auto
            "explain explain" auto / min-content min-content;
    }

    #side {
        margin-left: 8px;
    }
}

#title {
    grid-area: title;
    font-size: 4em;
    margin-top: 32px;
    margin-bottom: 16px;
}

#title .mainLine {
    font-family: "Bitcount Grid Double", system-ui;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings:
        "slnt" 0,
        "CRSV" 0.5,
        "ELSH" 0,
        "ELXP" 0;
    line-height: 0.8em;
}

#title .subLine {
    font-size: 0.25em;
    font-family: "Alfa Slab One", serif;
    font-weight: 400;
    font-style: normal;
}

#title .rust {
    background-color: #fd6f44;
    color: #000;
    border-radius: 4px;
    padding: 2px;
}

#game {
    grid-area: game;
    display: flex;
    flex-direction: column;
}

#game .gameTableContainer {
    flex-grow: 1;
}

#game .status {
    flex-grow: 0;
}

#side {
    grid-area: side;
    display: flex;
    flex-direction: column;
}

#side .player {
    min-width: 256px;
    border: 1px solid currentColor;
    padding: 8px;
}

#side .player.black {
    background-color: #000;
    color: #fff;
}

#history {
    flex-grow: 1;
    flex-basis: 4em;

    overflow-y: scroll;

    border: 1px solid black;
    padding: 0px;
    margin: 4px 0;

    list-style-type: none;
}

#history .item {
    padding: 8px;
}

#history .item.black {
    background-color: #d6d6d6;
}

.gameTable {
    border-collapse: collapse;
}

.gameCell {
    background-color: #a5b4a5;
    width: 48px;
    width: var(--game-cell-width, 48px);
    height: 48px;
    height: var(--game-cell-width, 48px);
    /* prevent cell shrinking */
    min-width: 48px;
    min-width: var(--game-cell-width, 48px);
    max-width: 48px;
    max-width: var(--game-cell-width, 48px);

    cursor: pointer;
    transition: background-color 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    padding: 0;
    border: 1px solid #697769;
    vertical-align: baseline;
    user-select: none;
}

.gameTable.readonly .gameCell {
    cursor: default;
}

.gameCell:hover {
    background-color: #90a790;
}

.gameCellContent.white,
.gameCellContent.black {
    width: 40px;
    width: var(--game-cell-content-width, 40px);
    height: 40px;
    height: var(--game-cell-content-width, 40px);
    border-radius: 50%;
    margin-top: 4px;
    margin-top: var(--game-cell-content-padding, 4px);
    margin-left: 4px;
    margin-left: var(--game-cell-content-padding, 4px);
    border: 1px solid #888;
    color: transparent;
    box-sizing: border-box;
}

.gameCellContent.white {
    background-color: #fff;
}

.gameCellContent.black {
    background-color: #000;
    border-color: #fff;
}

.gameCellContent.highlighted {
    outline-style: solid;
    outline-width: 3px;
    outline-color: #eb21b9;
}

.score.leading {
    font-weight: bold;
}

#explain {
    grid-area: explain;
}

#explain article {
    max-width: 720px;
    margin: auto;
    margin-top: 4em;
    margin-bottom: 40vh;
}

#explain hr {
    border: 1px solid #e2e2e2;
    width: 50%;
    margin-top: 3em;
    margin-bottom: 3em;
}