@import url('https://fonts.googleapis.com/css2?family=Margarine&display=swap');

:root{
    --card-width-lg:157px;
    --card-height-lg:220px;

    --card-width-sm:120px;
    --card-height-sm:168px;

    --num-cards: 4;

    --card-horizontal-space-lg: 100px;
    --card-horizontal-space-sm: 50px;

    --badge-bg-color:rgb(90, 90, 90);
    --primary-color:black;
    --secondary-color: #ffffff;

    --primary-font: 'Margarine', sans-serif;
}
body{
    height:100vh;
    font-family: var(--primary-font);
    font-style: normal;
    font-weight: 400;
}

main{
    height: 55%;
    display: flex;
    justify-content: center;
}

.card-container{
    position: relative;
    height: 100%;
    width:calc(var(--card-width-lg) * (var(--num-cards) / 2) + var(--card-horizontal-space-lg));
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "a b"
                         "c d";
}

.card-pos-a{
    grid-area: a;
}
.card-pos-b{
    grid-area: b;
}
.card-pos-c{
    grid-area: c;
}
.card-pos-d{
    grid-area: d;
}
.card-pos-a,.card-pos-b,.card-pos-c,.card-pos-d{
    display: flex;
    justify-content: center;
    align-items: center;
}

.card{
    position: absolute;
    height:var(--card-height-lg);
    width: var(--card-width-lg);
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.6s ease-in-out;
}
.card-inner{
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.card-front, .card-back{
    position: absolute;
    width: 100%;
    height: 100%;
    --webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.card-img{
    height: 100%;
}
.card-back{
    transform: rotateY(180deg);
}

.card-inner.flip-it{
    transform: rotateY(180deg);
}
header{
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}
.header-title-container{
    display: flex;
    justify-content: center;
}
.header-round-info-container{
    display: flex;
    justify-content: space-evenly;
}

.current-status{
    font-size:1.5rem;
    text-align: center;
}

.header-status-info-container,
.header-button-container,
.header-score-container,
.header-round-container,
.header-img-container{
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-score-container,
.header-round-container,
.header-img-container{
    width: 150px;
}
.header-img{
    height: 90px;
    border-radius: 6px;
    border: 1px solid rgba(19, 19, 19, 0.8);
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transform: rotate(-3deg);
}
.badge{
    background-color: var(--badge-bg-color);
    color: var(--secondary-color);
    padding: 2px 10px 3px;
    border-radius: 13px;
}

.game-play-button-container{
    width: 150px;
    height:70px;
}


#playGame {
  align-self: center;
  background-color: rgb(255, 255, 255);
  background-image: none;
  background-position: 0 90%;
  background-repeat: repeat no-repeat;
  background-size: 4px 3px;
  border-radius: 15px 225px 255px 15px 15px 255px 225px 15px;
  border-style: solid;
  border-width: 2px;
  box-shadow: rgba(0, 0, 0, .2) 15px 28px 25px -18px;
  box-sizing: border-box;
  color: #41403e;
  cursor: pointer;
  display: none;
  font-family: Neucha, sans-serif;
  font-size: 1rem;
  line-height: 23px;
  outline: none;
  padding: .75rem;
  text-decoration: none;
  transition: all 235ms ease-in-out;
  border-bottom-left-radius: 15px 255px;
  border-bottom-right-radius: 225px 15px;
  border-top-left-radius: 255px 15px;
  border-top-right-radius: 15px 225px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  animation: game-play-button-fade-in 10s 1;
}

#playGame:hover {
  box-shadow: rgba(0, 0, 0, .3) 2px 8px 8px -5px;
  transform: translate3d(0, 2px, 0);
}

#playGame:focus {
  box-shadow: rgba(0, 0, 0, .3) 2px 8px 4px -6px;
}

#playGame:active {
  box-shadow: none;
  transform: translate3d(0, 3px, 0);
}

@keyframes game-play-button-fade-in {
    from {opacity: 0;}
    to {opacity: 1;}
}

.card.shuffle-left{
    transform: translateX(300px) translateY(40px);
}

.card.shuffle-right{
    transform: translateX(-350px) translateY(-40px);
}

.card.fly-in{
    transform: translateY(-1000px) translateX(-600px) rotate(45deg);
}

@media screen and (max-width: 600px){
    .card{
        height:var(--card-height-sm);
        width: var(--card-width-sm);
    }
    .card-container{
        width:calc(var(--card-width-sm) * (var(--num-cards) / 2) + var(--card-horizontal-space-sm));
    }
    main{
        height: 50%;
    }
    .current-status{
        font-size:1.2rem;
    } 
    .game-play-button-container{
        width: 120px;
        height:40px;
    }
    #playGame {
        font-size: 12px;
        min-height: 12px;
        padding: 6px 8px;
    }
    .header-img{
        height: 55px;
    }                          
}
