body {
    background: #111;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    height: calc(100vh);
}

*, *::before, *::after {
    box-sizing: inherit;
}

.header {
    color: white;
    text-align: center;
}

.header h2 {
    font-size: 48px;
    margin: 12px 0 24px 0;
}

.game-container {
    height: calc(100vh - 91px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

#game-container {
    width: 100%;
    flex-shrink: 1;
}
#controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls button {
    padding: 1rem;
}

#game {
    max-width: 500px;
    position: relative;
    gap: 24px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    box-sizing: border-box;
    gap: 6px;
}

.guess {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 58px));
    height: 100%;
    justify-content: center;
    gap: 6px;
}

.tile-container {
    display: inline-block;
    width: 100%;
}

.tile-container.shake {
    animation: shake 0.2s ease-in-out 0s 2;
}

.tile {
    border: 2px solid #ffffff;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    line-height: 2rem;
    font-weight: bold;
    vertical-align: middle;
    box-sizing: border-box;
    color: #ffffff;
    text-transform: uppercase;
    user-select: none;
}

.tile::before {
    content: '';
    display: inline-block;
    padding-bottom: 100%;
}

#keyboard {
    margin: 0 8px;
    user-select: none;
    align-items: flex-end;
    width: 100%;
    padding: 0 8px;
}

.keyboard-row {
    display: flex;
    width: 100%;
    margin: 0 auto 8px;
    touch-action: manipulation;
}

.keyboard-row:nth-child(2) {
    padding: 0 8px;
}

.keyboard-row:nth-child(3) .key:last-child {
    flex-grow: 1;
    margin: 0;
    min-width: 35px;
}


.key {
    height: 58px;
    font-family: inherit;
    font-weight: bold;
    border: 0;
    padding: 0 4px;
    margin: 0 6px 0 0;
    font-size: 1.25em;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background-color: #818384;
    color: #FFFFFF;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    -webkit-tap-highlight-color: rgba(0,0,0,0.3);
}

#footer {
    width: 100%;
    text-align: center;
}

#bmac {
    color: teal;
    font-family: sans-serif;
    text-decoration: none;
}

.tile.flip {
    animation: 0.5s linear flipping;
}

@keyframes flipping {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@keyframes shake {
    0% {
        margin-left: 0rem;
    }
    25% {
        margin-left: 0.5rem;
    }
    75% {
        margin-left: -0.5rem;
    }
    100% {
        margin-left: 0rem;
    }
}

.incorrect {
    background-color: gray !important;
}

.semicorrect {
    background-color: rgb(255 255 57 / 86%) !important;
}

.correct {
    background-color: #6aaa64 !important;
}

.no-overlay {
    border: solid black 2px !important;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.tile.pop {
    animation: pop 0.3s ease-in-out;
}

@media (max-width: 640px) {
    .header h2 {
        font-size: 30px;
        margin: 0 0 12px 0;
    }
}
