body {
    background-color: rgb(59, 59, 59);
    font-family: "Comic Relief", system-ui;
    font-weight: 400;
    font-style: normal;
}

button {
    font-family: "Comic Relief", system-ui;
    font-weight: 400;
    font-style: normal;
    font-size: 20px;
}
/*this is where everything sits inside*/
.container {
    height: 800px;
    width: 800px;
    background-color: rgb(59, 59, 59);
    margin: auto;
    position: relative;
}

#win h1, #lose h1, #start h1 {
    padding: 20px;
    background-color: black;
}

#win, #lose, #start {
    width: 100%;
    height: 100%;
    background-color: black;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    color: white;
    text-align: center;
    z-index: 1000;
}

#win {
    background-image: url(../img/happy.png);
    background-repeat: no-repeat;
    background-size: cover;
}

#lose {
    background-image: url(../img/explosion.jpg);
    background-repeat: no-repeat;
    background-size: cover;
}

#start {
    background-color: rgb(28, 86, 43);
    display: block;
}

#start p {
    padding-left: 120px;
    padding-right: 120px;
}

/*box for wizard*/
#wizard {
    height: 220px;
    background-color: crimson;
    background-size: cover;
}

#wizard img {
    height: 220px;
    width: 800px;
    opacity: 1;
}

.shake {
    animation: horizontal-shaking 0.35s infinite;
}

/*progress bars*/
#magic {
    height: 20px;
    background-color: rgb(196, 211, 225);
    border-style: solid;
    border-color: rgb(59, 59, 59);
    border-bottom: none;
    position: relative;
}

#magic-bar {
    height: 20px;
    width: 0%;
    background-color: rgb(139, 73, 201);
    position:absolute;
    top: 0px;
    left: 0px;
}

#magic p {
    position:absolute;
    display: block;
    top: 0px;
    text-align: center;
    color: black;
    width: 100%;
    margin: 0px;
    z-index: 100;
}

#health {
    height: 20px;
    background-color: rgb(205, 44, 44);
    border-style: solid;
    border-color: rgb(59, 59, 59);
    position: relative;
}

#health-bar {
    height: 20px;
    width: 100%;
    background-color: rgb(20, 234, 116);
    position:absolute;
    top: 0px;
    left: 0px;
}

#health p {
    position:absolute;
    display: block;
    top: 0px;
    text-align: center;
    color: black;
    width: 100%;
    margin: 0px;
    z-index: 100;
}

/*box for cards*/
#card-grid-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 540px;
}

/*https://photics.com/flipping-a-card-with-html-css-javascript/*/

#card-grid {
    display: grid;
    justify-content: center;
    grid-gap: 10px;
    grid-template-columns: repeat(4, 150px);
    grid-template-rows: repeat(3, calc(100px / 2 * 3));
    
}

.card {
    height: 150px;
    width: 150px;
    border-radius: 10px;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s ease-in-out;
}

.back,
.front {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 10px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform ease-out 0.5s;
}

.back {
    background-image: url(../img/card-back.webp);
    background-size: cover;
}

.front {
    position: absolute;
    display: flex;
    transform: rotateY(-180deg);
    pointer-events: none;
    background-size: cover;
}

.flip.back {
    transform: rotateY(-180deg) !important;
}

.flip.front {
    transform: rotateY(-360deg) !important;
}

/*https://joannpan.medium.com/how-to-create-a-timer-that-increments-every-second-in-javascript-dd28b4c46d35*/
@keyframes horizontal-shaking {
 0% { transform: translateX(0) }
 25% { transform: translateX(5px) }
 50% { transform: translateX(-5px) }
 75% { transform: translateX(5px) }
 100% { transform: translateX(0) }
}

