html,
body {
    padding: 0;
    margin: 0;
}

body {
    background: linear-gradient(orange, red);
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Righteous', sans-serif;
}

button {
    padding: 10px 25px;
    border-radius: 20px;
    border: none;
    text-transform: uppercase;
    background: white;
    cursor: pointer;
}

button:hover {
    transition: background-color 75ms linear;
    background: orange;
    color: white;
    font-weight: bold;
}

header {
    background: red;
    color: white;
    font-size: 1.25rem;
    text-shadow: 1px 1px black;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

a {
    text-decoration: none;
    color: white;
}

a:hover {
    color: black;
    text-shadow: 1px 1px white;
    transition: color 150ms linear;
}

h1 {
    font-size: 5vw;
    word-wrap: break-word;
    white-space: wrap;
    color: white;
    text-align: center;
    text-shadow: .3vw .3vw orange,
                 .6vw .6vw red;
}

header,
footer {
    padding: 15px;
}

footer {
    color: white;
    text-shadow: 1px 1px black;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

main,
footer {
    align-self: center;
}

table {
    border-collapse: collapse;
    background: saddlebrown;
}

table,
tr,
td {
    border: 1px solid rgba(0, 0, 0, 0.35);
}

tr,
td {
    padding: 0;
    margin: 0;
}

td {
    box-sizing: border-box;
    height: min(10vw, 10vh);
    width: min(10vw, 10vh);
}

.player {
    height: 100%;
    background: #6017EB;
    position:relative;
}

.player::before {
    position: absolute;
    content: '';
    border-radius: 50%;
    background: black;
    width: 1vw;
    height: 1vw;
    top: 2vw;
    left: 1.2vw;
    box-shadow: 2.75vw 0 black;
}

.player::after {
    position: absolute;
    content: '';
    border-radius: 5px;
    width: 4vw;
    height: 2vw;
    top: 3.25vw;
    left: .8vw;
    border: .2vw solid black;
    background: linear-gradient(white 25%, red 25%, red 75%, white 75%);
    animation: 300ms infinite alternate-reverse munching;
}

.plant-stage-1,
.plant-stage-2,
.plant-stage-3 {
    height: 100%;
    transition: background-color 75ms linear;
}

.plant-stage-1 {
    background: forestgreen;
    border-radius: 50%;
    position: relative;
}

.plant-stage-1::before {
    position: absolute;
    top: 1vw;
    left: 1vw;
    content: '';
    border-radius: 50%;
    background-color: black;
    height: 1vw;
    width: 1vw;
    box-shadow: 2vw 0 black,
                1vw 1.5vw black;
}

.plant-stage-1::after {
    position: absolute;
    top: 1.1vw;
    left: 1.1vw;
    content: '';
    border-radius: 50%;
    background-color: white;
    height: .4vw;
    width: .4vw;
    box-shadow: 2vw 0 white,
                1.4vw 2vw palevioletred,
                1.3vw 2vw palevioletred;
}

.plant-stage-2 {
    background: yellow;
    border-radius: 35%;
    position: relative;
}

.plant-stage-2::before {
    position: absolute;
    top: 1.8vw;
    left: 1.5vw;
    content: '';
    border-radius: 50%;
    background-color: black;
    height: .75vw;
    width: .75vw;
    box-shadow: 2.8vw 0 black;
    transition: opacity 300ms linear;
}

.plant-stage-2::after {
    position: absolute;
    top: 3.3vw;
    left: 1.5vw;
    content: '';
    border-radius: 5px;
    background-color: black;
    height: .5vw;
    width: 3.8vw;
    transition: opacity 200ms linear;
}

.plant-stage-3 {
    background: black;
    border-radius: 15%;
    position: relative;
}

.plant-stage-3::after {
    content: '';
    position: absolute;
    height: .5vw;
    width: 1.25vw;
    top: 2.2vw;
    left: 1vw;
    background-color: white;
    border-radius: 2px;
    box-shadow: 3vw 0 white;
    transition: opacity 200ms linear;
}

.plant-stage-3::before {
    content: '';
    position: absolute;
    height: .5vw;
    width: 4.25vw;
    top: 4vw;
    left: 1vw;
    background-color: white;
    border-radius: 2px;
    transition: opacity 200ms linear;
}

.impassable {
    background: red;
}

.game-stats {
    display: flex;
    align-items: center;
    width: 100%;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin: 15px 0;
}

.flashing-red {
    animation: 750ms infinite alternate-reverse flashred; 
}

.table-container {
    position: relative;
}

#elasped-time-label {
    text-align: left;
}

#elasped-time-label::before {
    content: "Elasped Time: "
}

#max-population-label {
    text-align: right;
    margin-left: auto;
}

#max-population-label::before {
    content: "Population Limit: "
}

#start-game-table-overlay,
#end-game-table-overlay {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    width: 100%;
    height: 100%;
    top: 0;
}

#end-game-table-overlay > section,
#start-game-table-overlay > section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.hidden {
    display: none;
}

.instructions {
    color: white;
    text-shadow: 1px 1px black;
    margin: 0 30px 60px 30px;
    font-size: 1.3vw;
    text-align: center;
}

@keyframes flashred {
    from {
        color: black;
    }

    to {
        color: red;
    }
}

@keyframes munching {
    from {
        height: 2vw;
        background: linear-gradient(white 25%, red 25%, red 75%, white 75%);
    }

    to {
        height: 1vw;
        background: linear-gradient(white 46%, black 46%, black 54%, white 54%);
    }
    
}

@media (max-width: 700px) {
    .game-stats {
        flex-direction: column;
    }

    #max-population-label {
        text-align: left;
        margin-right: auto;
        margin-left: 0;
    }

    #elasped-time-label {
        width: 100%;
    }
} 