@import "../../vars.css";
@import "../../classes.css";
@import "../../header_style.css";

body {
    margin: 0;
    padding: 0;
    font-family: "Delius", cursive;
    font-weight: 600;
    font-style: normal;
}

/* Main Start */
main {
    background-color: var(--main-color);
    height: 500vh;
    margin-top: var(--header-height);
}

#game {
    display: flex;

    
    margin: auto;
    align-items: center;
    flex-direction: column;
    width: 90%;
}

.game-button {
    display: flex;
    aspect-ratio: 1/1;
    width: 10vw;

    background-color: red;
    color: white;
    border: 2px solid black;
    border-radius: 1000px;

    align-items: center;
    justify-content: center;

    user-select: none;
    -webkit-user-select: none; /* Safari, Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    transition: any 0.05s;
}

#clicker-button {
    display: none;
}

#card-grid {
    display: none;
    width: 75vmin;
    aspect-ratio: 1/1;

    gap: 5px;

    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.card {
    /* .card is a 3d container
        for card-face, card-front and card-back */
    display: flex;
    width: 100%;
    aspect-ratio: 1/1;
    perspective: 1000px;

    align-items: center;
    justify-content: center;

    background-color: white;
    border-radius: 15px;

    font-size: 10vmin;
    cursor: pointer;

    transition: transform 0.6s;
    
    transform-style: preserve-3d;
    user-select: none;
    z-index: 1;
}

.card-face {
    /* hide backface to hide mirroring */
    backface-visibility: hidden;
}

.card-front {
    transform: rotateY(180deg);
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-back {
    transform: rotateY(180deg);
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* if .card elem has .flipped */
.card.flipped {
    /* transition is triggered when attribute value changes */
    transform: rotateY(180deg);
}

@keyframes correct {
    0% { background-color: white; }
    50% { background-color: green; }
    100% { background-color: white; }
}
@keyframes wrong {
    0% { background-color: white; }
    50% { background-color: red; }
    100% { background-color: white; }
}
@keyframes shake {
  0%   { transform: rotateY(0deg) translateX(0); }
  20%  { transform: rotateY(0deg) translateX(-5px); }
  40%  { transform: rotateY(0deg) translateX(5px); }
  60%  { transform: rotateY(0deg) translateX(-5px); }
  80%  { transform: rotateY(0deg) translateX(5px); }
  100% { transform: rotateY(0deg) translateX(0); }
}

.card.correct {
    animation: correct 0.5s forwards;
}

.card.wrong {
    animation: wrong 0.5s forwards, shake 0.2s ease-in-out;
}


.menu-button {
    display: block;
    margin: 5vh auto;
    width: 10vw;
    aspect-ratio: 6/2;
    border: 2px solid black;
    border-radius: 10px;

    color: black;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
}

.menu-button:hover {
    background-color: var(--deep-color);
    color: white;
}
/* Main End */


