* {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

body {
    background: whitesmoke;
}

.wrapper {
    max-width: 50vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
}

h1 {
    font-size: 70px;
    font-style: italic;
    text-decoration: underline;
}

h2 {
    font-size: 50px;
    margin: 20px 0;
}

main {
    margin-bottom: 50px;
    width: 100%;
}

.slideRules {
    background: #A5DD9B;
    color: white;
    font-size: 30px;
    padding: 10px 20px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: pointer;
    letter-spacing: 2px;
}

#rules {
    background: #C5EBAA;
    font-size: 25px;
    padding: 20px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    display: none;
    letter-spacing: 2px;
}

.taskProgress, .timeProgress {
    position: fixed;
    left: 50px;
    top: 60vh;
    padding: 10px;
    width: 400px;
    height: 400px;
    text-align: center;
}

.timeProgress {
    top: 10vh;
}

.taskProgress p, .timeProgress p {
    margin-bottom: 20px;
    font-size: 30px;
}

#start {
    width: 250px;
    font-size: 40px;
    background: #A5DD9B;
    color: white;
    border-radius: 20px;
    margin: 20px 0;
    padding: 20px 10px;
    cursor: pointer;
    text-align: center;
}

#start:hover {
    background: #C5EBAA;
}

#win {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 30px;
    background: rgba(84, 230, 147, 0.4);
    border-radius: 20px;
    padding: 50px;
}

#win a {
    font-size: 40px;
    padding: 10px 20px;
    text-decoration: none;
    color: navy;
    margin-top: 20px;
}

#win a:hover {
    color: blue;
    text-decoration: underline;
}

.board {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 100px);
    gap: 10px;
}

.back img {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.board > div {
    text-align: center;
    line-height: 80px;
    cursor: pointer;
    transition: all 0.5s;
    transform-style: preserve-3d;
}

.back, .front {
    background: navy;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    backface-visibility: hidden;
}

.back {
    background: lightblue;
    transform: rotateY(180deg);
}

.flip {
    transform: rotateY(180deg);
}

.matched {
    border: 4px solid greenyellow;
    animation: pulse 2s 1;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px green;
    }
    50% {
        box-shadow: 0 0 15px green;
    }
    100% {
        box-shadow: 0 0 20px green;
    }
}