:root {
    --grid-rows: 10;
    --grid-cols: 10;
}

html, body {
    height: 100%;
}

html {
    display: table;
    margin-left: auto;
    margin-right: auto;
}

body {
    display: table-cell;
    padding: 15px;
}

#container {
    display: grid;
    border: 1px solid black;
    grid-template-rows: repeat(var(--grid-rows), 1fr);
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    margin-top: 20px;
    width: auto;
    height: auto;
}

.cell {
    border: 1px solid black;
    width: 30px;
    height: 30px;
}

.cell-start {
    border: 1px solid black;
    background-color: green;
}

.cell-finish {
    border: 1px solid black;
    background-color: red;
}

.cell-wall {
    border: 1px solid black;
    background-color: black;
}

.cell-visited {
    animation-name: visitedAnimation;
    animation-duration: 1.5s;
    animation-timing-function: ease-out;
    animation-delay: 0;
    animation-direction: alternate;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    animation-play-state: running;
    border: 1px solid black;
}

@keyframes visitedAnimation {
    0% {
        transform: scale(0.3);
        background-color: rgba(0, 0, 66, 0.75);
        border-radius: 45%;
    }

    50% {
        background-color: rgba(17, 104, 217, 0.75);
    }

    75% {
        transform: scale(1.2);
        background-color: rgba(0, 217, 159, 0.75);
    }

    100% {
        transform: scale(1);
        background-color: rgba(0, 190, 218, 0.75);
    }
}

.cell-shortest-path {
    animation-name: shortestPath;
    animation-duration: 1.5s;
    animation-timing-function: ease-out;
    animation-delay: 0;
    animation-direction: alternate;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    animation-play-state: running;
    border: 1px solid black;
}

@keyframes shortestPath {
    0% {
        transform: scale(0.6);
        background-color: rgb(255, 254, 106);
    }

    50% {
        transform: scale(1.2);
        background-color: rgb(255, 254, 106);
    }

    100% {
        transform: scale(1);
        background-color: rgb(255, 254, 106);
    }
}

.button-main {
    appearance: button;
    backface-visibility: hidden;
    background-color: #405cf5;
    border-radius: 6px;
    border-width: 0;
    box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset,rgba(50, 50, 93, .1) 0 2px 5px 0,rgba(0, 0, 0, .07) 0 1px 1px 0;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    font-family: -apple-system,system-ui,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif;
    font-size: 100%;
    height: 44px;
    line-height: 1.15;
    margin: auto;
    outline: none;
    overflow: hidden;
    padding: 0 25px;
    position: relative;
    text-align: center;
    text-transform: none;
    transform: translateZ(0);
    transition: all .2s,box-shadow .08s ease-in;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.button-reset {
    appearance: button;
    backface-visibility: hidden;
    background-color: #FF4742;
    border-radius: 6px;
    border-width: 0;
    box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset,rgba(50, 50, 93, .1) 0 2px 5px 0,rgba(0, 0, 0, .07) 0 1px 1px 0;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    font-family: -apple-system,system-ui,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif;
    font-size: 100%;
    height: 44px;
    line-height: 1.15;
    margin: auto;
    outline: none;
    overflow: hidden;
    padding: 0 25px;
    position: relative;
    text-align: center;
    text-transform: none;
    transform: translateZ(0);
    transition: all .2s,box-shadow .08s ease-in;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;   
}
