@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  background: var(--background);
  overflow:hidden;
  cursor:default;
  color: var(--text-whitecolor);
}
body.dark-theme {
  background: repeat url(img/background.jpg);
  color: var(--text-blackcolor);
  filter: opacity(95%) drop-shadow(10px 10px 15px rgb(98, 98, 180));
}
button {
  color: var(--text-whitecolor);
}
/* Убрать скрол */
:root::-webkit-scrollbar{
  display: none;
}
:root {
  scrollbar-width: none;
  -ms-overflow-style: none;
  --background-color: #ffffffcf;
  --text-blackcolor: #000000;
  --text-whitecolor: #ffffff;
  --accent-color: #628314;
  --color-cards: linear-gradient(
    217deg,
    rgba(72, 255, 0, 0.9),
    rgba(255, 0, 0, 0) 80.71%
    ),
    linear-gradient(127deg, rgba(19, 151, 19, 0.9), rgba(0, 255, 0, 0) 80.71%),
    linear-gradient(336deg, rgba(45, 177, 56, 0.9), rgba(0, 0, 255, 0) 80.71%);
  --color-back_buttons: #208339e6;
  --color-bh_buttons: #25d125c8;
  --color-buttons: #419f44d5;
  --color-h_buttons: #1fa025e1;
  --background: repeat url(img/background2.gif);
}
/* ------------ */
input.no-select:focus {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input.no-select::selection {
  background: transparent;
}
input.no-select::-moz-selection {
  background: transparent;
}
* {
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: -moz-none;
  -o-user-select: none;
  user-select: none;
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  padding: 10px;
  background-color: rgba(56, 55, 107, 0.884);
  -webkit-box-shadow: 0px 0px 100px 2000px rgba(24, 24, 26, 0.637);
  -moz-box-shadow: 0px 0px 100px 2000px rgba(24, 24, 26, 0.637);
  box-shadow: 0px 0px 100px 2000px rgba(24, 24, 26, 0.637);
  border-radius: 10px;
  text-align: center;
  z-index:10;
}

.popup h3 {
  margin: 0 0 20px;
  text-shadow: #5dc8e5 1px 1px 10px;
}
/* h3 {
  display: flex;
  margin-bottom: 0.7em;
  text-shadow: 5px 10px 15px 5px rgb(255, 253, 253);
  color: #000000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: 'Poppins', sans-serif;
} */
#menu {
  margin-top: 50px;
  text-align: center;
}
button#theme-toggle {
  background-color: var(--color-buttons);
  border: none;
  padding: 1px 5px;
  font-size: 12px;
  cursor: pointer;
  margin: 5px;
  border-radius: 5px;
}
button#theme-toggle:hover {
  background-color: var(--color-h_buttons);
}
button#theme-toggle:focus {
  background-color: var(--color-h_buttons);
}
button#difficultyBtn,  button#settingsBtn {
  background-color: var(--color-buttons);
  border: none;
  padding: 2px 15px;
  font-size: 18px;
  cursor: pointer;
  margin: 5px;
  border-radius: 5px;
}
button#difficultyBtn:hover, button#settingsBtn:hover {
  background-color: var(--color-h_buttons);
}
#settings, #difficulty {
  margin-top: 50px;
}
button#backBtn, button#backDifficultyBtn {
  background-color: var(--color-back_buttons);
  border: none;
  padding: 2px 15px;
  font-size: 16px;
  cursor: pointer;
  margin: 5px 0 0;
  border-radius: 5px;
}
button#backBtn:hover, button#backDifficultyBtn:hover {
  background-color: var(--color-bh_buttons);
}

.wrapper{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 15px;
  opacity: 1;
  border-radius: 10px;
  box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.397);
  margin: 5px 5px 5px 5px;

}
#game-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 600px;
  gap: 7px;
  margin: 0 auto;
}
.card {
  width: 70px;
  height: 70px;
  border-radius: 5px;
  background: var(--color-cards);
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.493);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  cursor: pointer;
  flex: max(70px, 100%/12 + 0.1%); 
}
.card.flipped {
  background: var(--background-color);
  cursor: default;
  animation: flipped 0.6s ease-in-out;
}

@keyframes flipped {
    0%, 100%{
      transform: translateX(0);
    }
    20%{
      transform: translateX(-13px);
    }
    40%{
      transform: translateX(13px);
    }
    60%{
      transform: translateX(-8px);
    }
    80%{
      transform: translateX(8px);
    }
  }

#next-level {
    display: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    border-radius: 5px;
    border: none;
    padding: 2px 11px;
    background-color: var(--color-back_buttons);
    transition: 0.3s ease;
    float: right;
    margin: 5px 0 0;
  }

#next-level:hover{
    color: #fff;
    background-color: var(--color-bh_buttons);
  }
#record-time {
    font-size: 14px;
    color: var(--text-color);
    text-align: center;
    margin: 7px 0 0;
    font-weight: 800;
  }

  @media screen and (max-width: 600px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 600px;
      gap: 7px;
      margin: 0 auto;
    }
    .card{
      height: 70px;
      width: 70px;
      flex: max(70px, 100%/10 + 0.1%);
    }
    .popup h3 {
      font-size:24px
    }

  }
  
  @media screen and (max-width: 430px) and (min-height: 900px){
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 430px;
      gap: 7px;
      margin: 0 auto;
    }
    .card{
      height: 70px;
      width: 70px;
      flex: max(70px, 100%/5 + 0.1%); 
    }
    .popup h3 {
      font-size:24px
    }
  }

  @media screen and (max-width: 450px) and (max-height: 950px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 450px;
      gap: 7px;
      margin: 0 auto;
    }
    .wrapper{
      margin: 5px 5px 5px 5px;
    }
    .card{
      height: 60px;
      width: 60px;
      flex: max(60px, 100%/5 + 0.1%); 
    } 
    h1, h2, h3 {
      font-size: 24px;
    }  
    button {
      font-size: 9px;
    }
  }

  @media screen and (max-width: 390px) and (max-height: 790px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 390px;
      gap: 7px;
      margin: 0 auto;
    }
    .wrapper{
      margin: 5px 5px 5px 5px;
    }
    .card{
      height: 45px;
      width: 45px;
      flex: max(45px, 100%/6 + 0.1%); 
    }  
  }
  @media screen and (max-width: 380px) and (max-height: 680px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 380px;
      gap: 5px;
      margin: 0 auto;
    }
    .wrapper{
      margin: 5px 5px 5px 5px;
    }
    .card{
      height: 40px;
      width: 40px;
      flex: max(40px, 100%/6 + 0.1%); 
    }  
  }
  @media screen and (max-width: 345px) and (max-height: 890px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 345px;
      gap: 7px;
      margin: 0 auto;
    }
    .wrapper{
      margin: 5px 5px 5px 5px;
    }
    .card{
      height: 50px;
      width: 50px;
      flex: max(50px, 100%/6 + 0.1%); 
    }  
  }
  @media screen and (max-height: 650px) {
    #game-board {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      max-width: 650px;
      gap: 7px;
      margin: 0 auto;
    }
    .wrapper{
      margin: 5px 5px 5px 5px;
    }
    .card{
      height: 60px;
      width: 60px;
      flex: max(60px, 100%/10 + 0.1%); 
    }  
  }