* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: none;
}

:root {
    --max-width: 350px;
    --data-size: 4;
}

:focus,
button:focus,
input:focus,
textarea:focus {
    outline: none;
}

body {
    font-family: "Clear Sans", Arial, sans-serif;
    background: #ffd89b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    flex-direction: column;
}

.container {
    margin: 0 auto;
    text-align: center;
    max-width: 520px;
}

.game-header {
    text-align: center;
    margin: 20px auto;
}

.title {
    font-size: 40px;
    font-weight: bold;
    color: #51370f;
    letter-spacing: 1.5px;
}

.title span {
    color: #b77200;
}

.score {
    display: flex;
    justify-content: center;
    gap: 175px;
    font-size: 18px;
    color: #342a1c;
    margin: 15px auto;
}

.game-mode {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px;
}

.game-mode button {
    font-size: 18px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    background-color: #b77200;
    color: white;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.game-mode button:hover {
    background-color: #8c621c;
    transform: translateY(-2px);
}

.game-mode button:active {
    transform: translateY(0);
}

.grid {
    display: grid;
    gap: 10px;
    background: #985f00;
    padding: 10px;
    border-radius: 10px;
    cursor: default;
    touch-action: none;
    grid-auto-flow: row dense;
    width: var(--max-width);
    margin: auto;
    grid-template-columns: repeat(var(--data-size), 1fr);
    grid-template-rows: repeat(var(--data-size), 1fr);
}

.cell {
    background-color: #472d05;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    color: #51370f;
    border-radius: 8px;
    user-select: none;
}

.number-cell {
    width: calc((var(--max-width) - ((var(--data-size) + 1) * 10px)) / var(--data-size));
    height: calc((var(--max-width) - ((var(--data-size) + 1) * 10px)) / var(--data-size));
    display: flex;
    border-radius: 7px;
    background: #d9b356;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    z-index: 10;
    font-size: 40px;
}

.bounceIn {
    transition: transform 0.3s;
    animation-duration: 0.75s;
    animation-name: bounceIn;
    transform: translate3d(0, 0, 0);
}

.jiggle {
    animation: jiggle 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.number-cell-correct {
    background: #ffb500;
}

.number-cell-empty {
    display: none;
}

footer {
    font-size: 12px;
    color: #342a1c;
    margin-top: 20px;
}

footer a {
    text-decoration: underline;
    color: inherit;
    font-weight: bold;
}

.modal-wrapper {
    z-index: 10;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
}

.modal-card {
    color: rgb(83, 70, 72);
    position: relative;
    z-index: 10000;
    animation-duration: 0.75s;
    animation-name: imUdsZ;
    border-radius: 10px;
    padding: 15px;
    min-width: 320px;
    background-color: #fff;
    height: 200px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
}

.modal-container {
    color: #342a1c;
    display: flex;
    flex-direction: column;
    place-content: space-around space-between;
    width: 100%;
    height: 100%;
    text-align: center;
    -webkit-box-pack: justify;
}

.modal-container .text-1 {
    font-family: Pacifico, cursive;
    text-align: center;
    font-weight: bold;
    font-size: 37px;
    color: #805000;
}

.modal-button {
    font-size: 22px;
    width: 100%;
    display: block;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    outline: none;
    text-decoration: none;
    line-height: 60px;
    text-align: center;
    background-color: #985f00;
    color: #fff;
    transition: opacity 0.3s;
}

.modal-bg {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    z-index: 1000;
    animation-duration: 0.75s;
    animation-name: fjoQCp;
    height: 100%;
    opacity: 0.3;
    background: rgb(0, 0, 0);
}

@keyframes bounceIn {

    from,
    20%,
    40%,
    60%,
    80%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }

    0% {
        opacity: 0;
        transform: scale3d(0, 0, 0);
    }

    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }

    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }

    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }

    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes jiggle {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}