html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    color: #e8e8e0;
    background: black;
    font-family: "Lucida Console", Monaco, "Courier New", Courier, monospace;
    font-size: 15px;
    line-height: 1.6;
    max-width: 800px;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px 58px 16px;
}

.page {
    border-left: 1px solid #303830;
    border-right: 1px solid #303830;
    min-height: 100%;
}

.masthead {
    border-top: 5px solid #99cc99;
    border-bottom: 1px solid #394839;
    align-items: flex-end;
    display: flex;
    gap: 0 16px;
    margin-bottom: 30px;
    padding: 16px 20px 0 20px;
}

.brand {
    flex: 1 1 auto;
    min-width: 0;
}

h1 {
    color: #f4f4ee;
    font-size: 31px;
    font-weight: normal;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
}

.cont {
    color: #a8b8a8;
    font-size: 13px;
    margin: 7px 0 16px 0;
}

.bar {
    display: flex;
    flex-shrink: 0;
    margin-left: auto;
}

.bar a {
    border: 1px solid #394839;
    border-bottom: 0;
    display: inline-block;
    font-size: 13px;
    letter-spacing: 0;
    margin-left: 4px;
    padding: 8px 11px 9px 11px;
}

.section {
    border-top: 1px solid #303830;
    margin: 0 20px 28px 20px;
    padding-top: 12px;
}

h2 {
    color: #99cc99;
    font-size: 17px;
    font-weight: normal;
    margin: 0 0 10px 0;
}

p {
    margin-top: 0;
}

ul {
    margin-top: 0;
    padding-left: 24px;
}

li {
    margin-bottom: 5px;
}

strong {
    color: #d8ffd8;
    font-weight: bold;
}

.article-page .section {
    margin-bottom: 31px;
}

#game-section {
    border-top: 0;
    padding-top: 0;
}

.foot {
    border-top: 1px solid #303830;
    color: #a8b8a8;
    font-size: 12px;
    margin: 40px 20px 0 20px;
    padding-top: 11px;
    text-align: center;
    text-transform: uppercase;
}

a {
    color: #99cc99;
    text-decoration: none;
}

a:hover,
a:focus {
    background: #132013;
    color: #d8ffd8;
    text-decoration: underline;
}

#game {
    background: #030603;
    border: 1px solid #303830;
    color: #e8e8e0;
    margin: 0;
    padding: 12px;
}

#mode-select {
    border-bottom: 1px solid #303830;
    margin-bottom: 16px;
    padding-bottom: 10px;
}

.mode-label {
    color: #a8b8a8;
    display: inline-block;
    font-size: 13px;
    margin-right: 5px;
}

button {
    background: black;
    border: 1px solid #394839;
    box-sizing: border-box;
    color: #99cc99;
    cursor: pointer;
    font-family: "Lucida Console", Monaco, "Courier New", Courier, monospace;
    font-size: 15px;
    line-height: 1.2;
    margin: 0;
    padding: 8px 9px;
}

button:hover:not(:disabled),
button:focus:not(:disabled),
.mode-button.active-mode {
    background: #132013;
    color: #d8ffd8;
}

button:disabled {
    color: #607060;
    cursor: default;
}

#stats-and-flag {
    margin: 18px 0 16px 0;
    position: relative;
}

#stats-block {
    left: 0;
    bottom: 0;
    position: absolute;
    width: 150px;
}

#flag-container {
    background: black;
    border: 1px solid #394839;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    width: 360px;
}

#flag-image {
    display: block;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
    width: 100%;
    -webkit-user-drag: none;
}

#flag-cover {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.cover-tile {
    background: #071107;
    border: 1px solid #132013;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.2s ease-out;
}

.cover-tile.revealed {
    opacity: 0;
}

#controls {
    align-items: stretch;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    width: 100%;
}

#guess-input {
    background: black;
    border: 1px solid #394839;
    box-sizing: border-box;
    color: #f4f4ee;
    flex: 1 1 auto;
    font-family: "Lucida Console", Monaco, "Courier New", Courier, monospace;
    font-size: 15px;
    line-height: 1.2;
    min-width: 0;
    padding: 8px 9px;
    width: 100%;
}

#controls button {
    flex: 0 0 auto;
    min-height: 100%;
    white-space: nowrap;
}

#message {
    color: #d8ffd8;
    min-height: 1.6em;
    margin-bottom: 0;
}

#meta-hints {
    color: #a8b8a8;
    min-height: 0;
}

#guesses {
    border-top: 1px solid #303830;
    list-style: none;
    margin: 2px 0 0 0;
    padding-left: 0;
}

#guesses li {
    border-bottom: 1px solid #303830;
    color: #d8d8d0;
    margin: 0;
    padding: 4px 0;
}

@media screen and (max-width: 560px) {
    body {
        font-size: 14px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .masthead {
        display: block;
    }

    .brand,
    .bar {
        width: 100%;
        text-align: left;
    }

    .bar {
        border-top: 1px solid #303830;
        flex-wrap: wrap;
        margin-top: 13px;
    }

    .bar a {
        margin: 0 4px 0 0;
        padding-left: 9px;
        padding-right: 9px;
    }

    h1 {
        font-size: 25px;
    }

    #stats-and-flag {
        min-height: 0;
    }

    #stats-block {
        margin-bottom: 12px;
        position: static;
        width: auto;
    }

    #controls,
    #guess-input,
    #controls button {
        display: block;
        width: 100%;
    }

    #controls button {
        margin-top: 6px;
    }
}
