@import url('https://fonts.googleapis.com/css2?family=Headland+One&display=swap');


/* BASIC RULES */

html
{
    background-image: url("../img/bgTexture.png");
}

p
{
    font-family: "Headland One", serif;
    font-weight: 400;
    font-style: normal;
    color: yellow;
}

h1
{
    font-family: "Headland One", serif;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    font-size: 2em;
    color: yellow;
}

button
{
    width: 300px;
    height: 75px;
    background-color: rgba(0, 0, 0, 0);
        font-family: "Headland One", serif;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    font-size: 3em;
    color: yellow;
    border-style: none;
}

/* LAYOUTS */

#playButton
{
    position: fixed;
    top: 50%;
    left: 38%;
    animation: buttonFlyOut 1s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
}

#win
{
    position:fixed;
    z-index: 9999;
    top: 50%;
    left: 28%;
    display: flex;
    justify-content: center;
    align-items:center;
    transform-origin: 50% 50%;
        font-family: "Headland One", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 0;
    animation: winnerGrowOut 1s ease-out 0s 1 normal forwards,
                winnerBanner 1s linear 0s infinite normal;
    animation-play-state: paused;
}

#mainCon
{
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    left: -85%;
    animation: cardsEnter 1s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
}

#playArea
{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cardRowGrid
{
    display: inline-grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.cardContainer
{
    background-color: transparent;
    width: 100px;
    height: 150px;
}

.starAnimation
{
    position: relative;
    z-index: 9999;
}

.starContainer
{
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.starContainer img
{
    position: absolute;
    top: 40px;
}

.starImg1
{
    animation: starMove1 1.5s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
    display: none;
}

.starImg2
{
    animation: starMove2 1.5s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
    display: none;
}

.starImg3
{
    animation: starMove3 1.5s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
    display: none;
}
.starImg4
{
    animation: starMove4 1.5s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
    display: none;
}
.starImg5
{
    animation: starMove5 1.5s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
    display: none;
}


.cardContainerInner
{
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    animation: cardSpin 1s ease-out 0s 1 normal forwards;
    animation-play-state: paused;
}

.cardFront, .cardBack
{
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: fixed;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    box-shadow: inset 0px 0px 2px #000;
    border-radius: 8px;
}

.cardFront
{
    background-color: white;
    animation-name: frontCardFlip;
    animation-duration: 0.75s;
    animation-direction: alternate;
    animation-iteration-count: infinite;
    animation-play-state: paused;
}

.cardBack
{
    background-color: red;
    animation-name: backCardFlip;
    animation-duration: 0.75s;
    animation-direction: alternate;
    animation-iteration-count: infinite;
    animation-play-state: paused;
}

aside
{
    display: flex;
    flex-direction: row;
    justify-content: center;
}

#score
{
    margin: 20px 15px 0px 15px;
    opacity: 0;
    animation: scoreIn 1s linear 0s 1 normal forwards;
    animation-play-state: paused;
}

#attempts
{
    margin: 20px 15px 0px 15px;
    opacity: 0;
    animation: scoreIn 1s linear 0s 1 normal forwards;
    animation-play-state: paused;
}

/* MEDIA QUERIES */

@media screen and (max-width: 916px)
{
    .cardContainer
    {
        width: 50px;
        height: 75px;
    }

    #win
    {
        top: 23%;
        left: 15%;
    }
}

/* ANIMATIONS */

@keyframes buttonFlyOut
{
    0%
    {
        left: 38%;
    }
    99%
    {
        left:200%

    }
    100%
    {
        left: 200%;
        display: none;
    }
}

@keyframes cardsEnter
{
    0%
    {
        left: -100%;
    }
    100%
    {
        left: 0%;
    }
}

@keyframes cardSpin
{
    0%
    {
        transform: rotateZ(0deg);
    }
    100%
    {
        transform: rotateZ(1080deg);
    }
}

@keyframes scoreIn
{
    0%
    {
        opacity: 0;
    }
    80%
    {
        opacity: 0;
    }
    100%
    {
        opacity: 1;
    }
}

@keyframes frontCardFlip
{
    0%
    {
        transform: rotateY(180deg);
    }
    100%
    {
        transform: rotateY(0deg);
    }
}

@keyframes backCardFlip
{
    0%
    {
        transform: rotateY(0deg);
    }
    100%
    {
        transform: rotateY(180deg);
    }
}

@keyframes winnerGrowOut
{
    0%
    {
        font-size: 0pt;
    }
    100%
    {
        font-size: 72pt;
        display: block;
        animation-play-state: paused;

    }
}

@keyframes winnerBanner
{
    0%
    {
        color: red;
    }
    16%
    {
        color: yellow;
        
    }
    33%
    {
        color: #00ff00;
    }
    50%
    {
        color: aqua;
    }
    66%
    {
        color: blue;
    }
    82%
    {
        color:violet;
    }
    100%
    {
        color: red;
    }
}

@keyframes starMove1 
{
    0%
    {
        top: 40px;
    }
    80%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
        top: 200px;
    }
}
@keyframes starMove2
{
    0%
    {
        top: 40px;
        left: 0px;
    }
    80%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
        top: 130px;
        left: 110px;
    }
}
@keyframes starMove3
{
    0%
    {
        top: 40px;
        left: 0px;
    }
    80%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
        top: 130px;
        left: -110px;
    }
}
@keyframes starMove4
{
    0%
    {
        top: 40px;
        left: 0px;
    }
    80%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
        top: -100px;
        left: 135px;
    }
}
@keyframes starMove5
{
    0%
    {
        top: 40px;
        left: 0px;
    }
    80%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
        top: -100px;
        left: -135px;
    }
}