body {
    background-color: #009688;
    font-family: sans-serif;
    overscroll-behavior-y: contain;
    margin-top: 0px;
    margin-bottom: 0px;
}

#instructions-overlay {
    background-color: rgba(200, 200, 200, 190);
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100vw;
    min-height: 100vh;
}

#content, #instructions {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    min-height: 100vh;
}

#instructions img {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

#close-instructions {
    margin-bottom: 1em;
}

h1, h2 {
    text-align: center;
    padding-left: 1em;
    padding-right: 1em;
}

#message {
    font-size: large;
    text-align: center;
}

.gap {
    display: none;
}

#game-grid {
    display: grid;
    margin-left: auto;
    margin-right: auto;
    width: 70%;
    aspect-ratio: 1 / 1;
    container-type: size;
    gap: 2%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
}

#game-grid.playing {
    touch-action: none;
}

.letter {
    padding-top: 2cqh;
    font-size: 12cqh;
    text-align: center;
    border-radius: 3cqh;
    border-style: solid;
    border-top-width: 0.5cqh;
    border-left-width: 0.5cqh;
    border-right-width: 0.5cqh;
    border-bottom-width: 2cqh;
}

#game-grid.playing .letter.wrong-position:hover,
#game-grid.playing .letter.wrong:hover {
    cursor: grab;
}

.letter:hover {
    cursor: default;
}

#game-grid.playing .letter.correct, #game-grid.won .letter {
    border-color: #649e53;
    background-color: #6fb05c;
    color: white;
}

#game-grid.playing .letter.wrong-position {
    border-color: #d1a734;
    background-color: #e9ba3a;
    color: white;
}

#game-grid.playing .letter.wrong {
    border-color: #d5d7d8;
    background-color: #edeff1;
    color: black;
}

#game-grid.lost .letter.wrong-position, #game-grid.lost .letter.wrong {
    color: white;
    background-color: #1a1a1b;
    border-color: #1a1a1b;
}

#game-grid.lost .letter.correct {
    color: white;
    background-color: #454747;
    border-color: #454747;
}

.letter.sliding {
    animation: 0.25s ease-in 0s slide;
    animation-fill-mode: forwards;
}

#game-grid.won .letter {
    animation-duration: 0.5s;
    animation-name: wave;
    animation-timing-function: ease-in-out;
}

#game-grid.won .letter.col0 {
    animation-delay: 0.0s;
}

#game-grid.won .letter.col1 {
    animation-delay: 0.125s;
}

#game-grid.won .letter.col2 {
    animation-delay: 0.25s;
}

#game-grid.won .letter.col3 {
    animation-delay: 0.375s;
}

#game-grid.won .letter.col4 {
    animation-delay: 0.5s;
}

.stars span {
    display: inline-block;
    width: 2em;
    height: 1.91em;
    background-repeat: no-repeat;
    background-size: cover;
}

.stars span.filled {
    background-image: url("filled-star.png");
}

.stars span.empty {
    background-image: url("empty-star.png");
}

@keyframes slide {
    to {
        transform: translate(0px, 0px);
    }
}

@keyframes wave {
    50% {
        transform: translate(0px, -1em);
    }
    to {
        transform: translate(0px, 0px);
    }
}

#swaps-remaining {
    margin-top: 2em;
    font-size: large;
    text-align: center;
    font-weight: bold;
}

#statistics table {
    margin-left: auto;
    margin-right: auto;
}

#statistics table th {
    background-color: #f6f7f8;
    padding: 0.5em;
    text-align: left;
}

#statistics p, #instructions p {
    margin: 2em;
    text-align: center;
}

button {
    margin-top: 0.5em;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: block;
    background-color: #6fb05c;
    border-color: #649e53;
    border-style: none none solid none;
    border-width: 0.2em;
    font-size: 1.8em;
    color: white;
    padding: 0.2em 0.4em;
    border-radius: 0.5em;
}

button:active {
    border-style: solid none none none;
    border-color: #6fb05c;
}

.notice {
    position: fixed;
    display: inline-block;
    top: 3em;
    left: 50%;
    transform: translate(-50%, 0%);
    font-size: large;
    font-weight: bold;
    animation: 0.25s ease-out 3s fade-out;
    animation-fill-mode: forwards;
    color: white;
    background-color: #454747;
    padding: 1em 1.5em;
}

.title-bar {
    display: flex;
}

.title-bar h1 {
    flex-grow: 1;
}

.title-left-space, .title-bar svg {
    width: 2em;
    padding: 0 1.5em;
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

@media only all and (max-width: 45em) {
    #content, #instructions {
        position: absolute;
        top: 0px;
        left: 0px;
        width: 100%;
        margin-left: 0px;
        margin-right: 0px;
        border-radius: 0px;
    }
}

@media not all and (max-width: 45em) {
    #content, #instructions {
        max-width: 40em;
        margin-left: auto;
        margin-right: auto;
    }
}
