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

body {
    background: linear-gradient(lime, darkgreen);
    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: green;
    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: 10vmin;
    word-wrap: break-word;
    white-space: wrap;
    color: white;
    text-align: center;
    text-shadow: .5vmin .5vmin lime,
                 1vmin 1vmin darkgreen;
}

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: 10vmin; /* before: min(10vw, 10vh); */
    width: 10vmin;
}

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

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

.player::after {
    position: absolute;
    content: '';
    border-radius: 5px;
    width: 5vmin;
    height: 6vmin;
    top: 3.25vmin;
    left: 2vmin;
    border: .2vmin 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: 1vmin;
    left: 1vmin;
    content: '';
    border-radius: 50%;
    background-color: black;
    height: 1vmin;
    width: 1vmin;
    box-shadow: 2vmin 0 black,
                1vmin 1.5vmin black;
}

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

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

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

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

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

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

.plant-stage-3::before {
    content: '';
    position: absolute;
    height: .5vmin;
    width: 4.25vmin;
    top: 4vmin;
    left: 1vmin;
    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: 2vmin;
    text-align: center;
}

@keyframes flashred {
    from {
        color: black;
    }

    to {
        color: red;
    }
}

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

    to {
        height: 1vmin;
        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%;
    }
} 