/* ---------- Reset ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Page ---------- */

html,
body {
    height: 100%;
}

body {
    font-family: sans-serif;
    background: #fff;
    color: #333;
}

/* ---------- Center the game ---------- */

#wrapper {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 2rem;
}

#inner {
    display: flex;
    justify-content: center;
}

/* ---------- Game ---------- */

.game {
    padding: 24px;

    background: #fff;

    border: 1px solid #ddd;
    border-radius: 8px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------- Top bar ---------- */

.gameinfo {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 20px;
}

/* ---------- Go button ---------- */

#go {
    padding: 8px 18px;

    border: 1px solid #bbb;
    border-radius: 4px;

    background: #f8f8f8;

    cursor: pointer;
    font-size: 1rem;
}

#go:hover {
    background: #ececec;
}

/* ---------- Score ---------- */

.score {
    display: inline-block;

    min-width: 60px;

    padding: 6px 12px;

    border-radius: 20px;

    background: rgb(236, 197, 203);

    color: #444;
    font-weight: bold;
    text-align: center;
}

/* ---------- Memory board ---------- */

#memory-board {
    width: 216px;

    display: grid;
    grid-template-columns: repeat(4, 48px);
    grid-template-rows: repeat(4, 48px);

    gap: 8px;

    margin: 0 auto;
}

#memory-board div {
    width: 48px;
    height: 48px;

    border-radius: 4px;

    cursor: pointer;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    transition:
        background-color .15s,
        transform .1s ease;
}

#memory-board div:hover {
    transform: scale(1.05);
}

/* ---------- High scores ---------- */

.highscore {
    color: #c62828;
    font-weight: bold;
}

ul {
    list-style: none;
    margin-top: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin: .35rem 0;
}

/* ---------- Form ---------- */

form {
    margin-bottom: 2rem;
}

form div {
    margin-bottom: 1rem;
}

form label {
    display: block;
    margin-bottom: .4rem;
    font-weight: bold;
}

form input[type="text"],
form input[type="number"] {
    width: 100%;

    padding: .65rem .8rem;

    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 1rem;
}

form button {
    padding: .7rem 1.2rem;

    border: 1px solid #bbb;
    border-radius: 4px;

    background: #f6f6f6;

    cursor: pointer;
}

form button:hover {
    background: #ececec;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {

    .game {
        padding: 16px;
    }

    .gameinfo {
        flex-direction: column;
        gap: 12px;
    }
}

