@import url('https://fonts.googleapis.com/css?family=Gaegu');
html {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    -webkit-box-sizing: inherit;
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: rgb(253, 253, 253);
    font-family: 'Gaegu', cursive;
    font-size: 1.5rem;
}

.container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

h1 {
    font-family: 'Gaegu', cursive;
    font-weight: 400;
    font-size: 3rem;
}

h2 {
    font-size: 1.5rem;
}

header {
    height: 100px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.restart {
    font-size: 1.5rem;
    line-height: 2;
}

/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    padding: 32px;
    border-radius: 10px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin: -2rem 0 0 0;
}

.deck .card {
    height: 125px;
    width: 125px;
    background: url("../img/pattern.svg"), rgb(151, 166, 230);
    font-size: 0;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
    border: 1px solid rgb(129, 129, 129);
}

.deck .card.open {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    position: relative;
    -webkit-transition: .7s ease-out;
    -o-transition: .7s ease-out;
    transition: .7s ease-out;
    /* backface-visibility: hidden; */
    background: url("../img/pattern.svg");
    cursor: default;
    pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.deck .card.match {
    cursor: default;
    background: #2c40f077;
    font-size: 33px;
    pointer-events: none;
    z-index: 9;
}

.images {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    position: relative;
    z-index: -1;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    border: 1px solid rgb(129, 129, 129);
    -moz-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
}

.paired {
    -webkit-transform: none;
    -ms-transform: none;
    transform: none;
    opacity: .7;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
}

/*
 * Styles for the Score Panel
 */

.score-panel {
    width: 560px;
    margin: 1rem 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.score-panel-element {
    width: 120px;
}

.score-panel .stars {
    margin: 0;
    margin-left: 2rem;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
    background: white;
}

.score-panel .stars li {
    list-style: none;
    display: inline-block;
}

.score-panel .restart {
    float: right;
    cursor: pointer;
    margin-top: -.35rem;
}

.moves {
    line-height: 1;
}

/* -- Styles for the pop-up -- */

/* -- Adapted from https://sabe.io/tutorials/how-to-create-modal-popup-box -- */

.popup {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    z-index: 99;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background: url('../img/geometry2.png');
    padding: 1rem 2.5rem;
    width: 26rem;
    border-radius: 0.5rem;
}

.close-button {
    font-size: 30px;
    float: right;
    width: 3rem;
    margin-top: .5rem;
    line-height: 3rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: rgb(231, 231, 231);
}

.close-button:hover {
    background-color: darkgray;
}

.show-popup {
    opacity: 1;
    visibility: visible;
    -webkit-transform: scale(1.0);
    -ms-transform: scale(1.0);
    transform: scale(1.0);
    -webkit-transition: visibility 0s linear 0s, opacity 0.25s 0s, -webkit-transform 0.25s;
    transition: visibility 0s linear 0s, opacity 0.25s 0s, -webkit-transform 0.25s;
    -o-transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s, -webkit-transform 0.25s;
}
.cat-gif{
    position: absolute;
    top: 30%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -30%);
}


/* ---MEDIA QUERIES-----breakpoint 373px-------- */

@media only screen and (max-width: 373px) {
    .container {
      width: 100%;

     
    }
    h1{
        margin: 1rem 0;
        line-height: 1;
        height: 80px;
    }
    .score-panel{
        width: 90%;
        margin: 1rem 0 0 0;

    }
    .deck{
        width: 95%;
        min-height: 380px;
        margin: 1rem 0 0 -1rem;
        padding: 0;
    }
    .deck .card{
        width: 55px;
        height: 55px;
        margin-left: 1rem;
    }
    .popup-content{
        padding: .5rem;
        width: 90%;
    }
}

/* ---MEDIA QUERIES-----breakpoint 442px-------- */

@media only screen and (min-width: 374px) and (max-width: 442px) {
    .container {
      width: 100%;
    }
    h1{
        margin: 1rem 0;
        line-height: 1;
        height: 80px;
    }
    .score-panel{
        width: 90%;
        margin: 0;

    }
    .deck{
        width: 95%;
        min-height: 400px;
        margin: 1rem 0 0 -2rem;
        padding: 0;
    }
    .deck .card{
        width: 65px;
        height: 65px;
        margin-left: 1.2rem;
    }
    .popup-content{
        padding: .5rem;
        width: 90%;
    }
}



/* ---MEDIA QUERIES-----breakpoint 537px-------- */

@media only screen and (min-width: 443px) and (max-width: 537px)  {
    .container {
        width: 100%;
      }
      h1{
          margin: 1rem 0;
          line-height: 1;
          height: 80px;
      }
      .score-panel{
          width: 90%;
          margin: 0;
      }
      .deck{
          width: 95%;
          min-height: 450px;
          margin: 0 0 0 -2rem;
          padding: 0;
      }
      .deck .card{
          width: 80px;
          height: 80px;
          margin-left: 1.4rem;
      }
  }

  /* ---MEDIA QUERIES-----breakpoint 610px-------- */

@media only screen and (min-width: 538px) and (max-width: 610px)  {
    .container {
        width: 100%;
      }
      h1{
          margin: 1rem 0;
          line-height: 1;
          height: 80px;
      }
      .score-panel{
          width: 90%;
          margin: 0;
      }
      .deck{
          width: 95%;
          min-height: 550px;
          margin: 0 0 0 -2rem;
          padding: 0;
      }
      .deck .card{
          width: 100px;
          height: 100px;
          margin-left: 1rem;
      }
  }
