body,
input {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
        "Open Sans", "Helvetica Neue", sans-serif;
    font-weight: 300;
}

h1 {
    text-align: center;
    margin: 15px auto;
}

button {
    position: relative;
    font-family: inherit;
    padding: 5px 5px;
    cursor: pointer;
    background: white;
    border: 2px solid steelblue;
    color: steelblue;
    font-size: 1em;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
    margin: 2px;
}

button:hover {
    box-shadow: 1px 3px 3px 0 #b9b9b9a8;
}

button:active {
    transform: translateY(2px);
}

button:disabled {
    cursor: not-allowed;
    background: rgb(231, 231, 231);
    color: gray;
    border: 2px solid gray;
    box-shadow: none;
}

/* Top level "menu" */

.controls div {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    width: 30vw;
    min-width: 300px;
    margin-bottom: 10px;
}

.controls button:first-of-type {
    margin-left: 0;
}

.controls button:last-of-type {
    margin-right: 0;
}

.controls .saved:after {
    content: "d";
}

/* Popups*/

.popup {
    width: 90%;
    max-width: 500px;
    min-width: 250px;
    position: absolute;
    top: 40px;
    left: 50vw;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    box-sizing: border-box;
    border: 2px solid steelblue;
    border-radius: 5px;
    box-shadow: 0 0 9999px 9999px rgba(70, 130, 180, 0.38);
    z-index: 10;
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.1s linear;
}

.popup img {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto;
}

.close {
    position: absolute;
    border: 1px solid tomato;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    top: -18px;
    right: -18px;
    background: white;
    box-sizing: border-box;
    transition: all 0.1s linear;
}

.close:before,
.close:after {
    content: " ";
    width: 27px;
    height: 1px;
    background: tomato;
    position: absolute;
    top: 50%;
    left: 50%;
}

.close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.close:hover {
    cursor: pointer;
    transform: rotate(90deg);
}

/* Leaderboard */

.leaderboard-table {
    width: 100%;
    text-align: left;
}

/* Game board and levels */

.board {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 30vw;
    height: 30vw;
    min-width: 300px;
    min-height: 300px;
    margin: 10px auto;
    border: 2px solid steelblue;
    background: rgb(235, 239, 245);
    box-sizing: border-box;
    border-radius: 5px;
    font-size: 40px;
    color: steelblue;
}

.cell,
.level {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid steelblue;
    box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2);
    margin: 2px;
    border-radius: 5px;
    transition: all 0.1s ease-in;
}

.cell {
    position: absolute;
    background: white;
}

.cell--can-move {
    cursor: pointer;
}

.level {
    width: calc(100% / 3 - 4px);
    height: calc(100% / 3 - 4px);
    position: relative;
}

.level__score {
    font-size: 0.35em;
    position: absolute;
    bottom: 5%;
    text-align: center;
}

.level__true {
    border-width: 2px;
    background: white;
    cursor: pointer;
}

.level__false {
    background: rgb(231, 231, 231);
    color: gray;
    border: 2px solid gray;
    cursor: not-allowed;
}

.game-over:after {
    content: "🏆";
    font-size: 1em;
    align-items: center;
    justify-content: center;
    display: flex;
    position: absolute;
    bottom: calc(50% / 3);
    right: calc(50% / 3);
    transform: translate(50%, 50%);
    box-sizing: border-box;
}

/* After win controls */

.win {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    font-size: 0.8em;
    box-sizing: border-box;
}

.win-controls {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    font-size: 0.7em;
}

.win-controls :after {
    box-sizing: border-box;
    width: 100%;
    font-size: 3em;
    display: block;
}

.win-controls div {
    cursor: pointer;
    border: 1px solid steelblue;
    border-radius: 10px;
    background: white;
    flex: 0 0 30%;
}

.win-controls div:hover {
    transform: translateY(-2px);
    box-shadow: 1px 3px 3px 0 #b9b9b9a8;
}

.win-controls div:active {
    transform: translateY(0);
}

.win-controls__all:after {
    content: "✸";
}

.win-controls__retry:after {
    content: "↺";
}

.win-controls__next:after {
    content: "▶";
}

/* Game Stats */

.game-stats {
    text-align: center;
    margin: 15px auto;
    font-size: 1.1em;
}

/* Contacts */

.contacts-links {
    text-align: center;
    font-size: 0;
    margin-top: 30px;
}

.contacts-links svg {
    margin: 0 5px;
}

.contacts-links svg:hover {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

/* Sumbit Record Pop-up */

.submit-result {
    display: block;
    top: 20vh;
    text-align: center;
    font-size: 20px;
}

.submit-result input {
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    margin: 2px;
    font-size: 18px;
}

.submit-result button {
    color: white;
    background: steelblue;
}

/* Additional */

.hidden {
    visibility: hidden;
    opacity: 0;
    transition: all, 0.1s linear;
}

.innactive:after {
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.container .none {
    display: none;
}

.loading:after {
    content: "↻";
    display: inline-block;
    animation: rotating infinite 1s linear;
}

/* Media */
@keyframes rotating {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    .board {
        min-width: 480px;
        min-height: 480px;
        font-size: 60px;
    }

    .controls div {
        min-width: 480px;
    }
}
