:root {
  --text-color: #70a751;
  --text-shadow: 1px 1px 20px #c2cc54;
}

/*Обнуление*/
* {
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
}
*,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
:focus,
:active {
  outline: none;
}
a:focus,
a:active {
  outline: none;
}
nav,
footer,
header,
aside {
  display: block;
}
html,
body {
  height: 100%;
  width: 100%;
  font-size: 100%;
  line-height: 1;
}
input,
button,
textarea {
  font-family: inherit;
}
input::-ms-clear {
  display: none;
}
button {
  cursor: pointer;
}
button::-moz-focus-inner {
  padding: 0;
  border: 0;
}
a,
a:visited {
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
ul li {
  list-style: none;
}
ol li {
  list-style: none;
}
img {
  vertical-align: top;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: 400;
}
html {
  scroll-behavior: smooth;
}
/*--------------------*/

/* * {
  outline: 1px solid red;
} */

/*--------------------*/

body {
  background: url(../images/bg.gif) no-repeat;
  background-size: cover;
  background-position: center center;
  color: var(--text-color);
  font-family: 'Yanone Kaffeesatz', 'Roboto', sans-serif;
  font-size: 20px;
  /* background-origin: border-box; */
  /* position: relative; */
}
.container {
  max-width: 1024px;
  margin: 0 auto;
}

/*--------------------*/
/*Рекорд и время*/
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  height: 8vh;
  box-sizing: border-box;
}
.score > span,
.time > span {
  text-shadow: 1px 1px 20px linear-gradient(to right, #70a751, #c2cc54);
}
.audio-icon {
  filter: invert(45%) sepia(13%) saturate(1802%) hue-rotate(64deg)
    brightness(100%) contrast(81%);
  width: 25px;
}

/*--------------------*/
/*Игра*/
main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 16vh);
}
.game {
  flex-basis: 64vw;
  height: 76vh;
  margin: auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  perspective: 1000px; /*насколько далеко в zплоскости находится объект от пользователя*/
  z-index: 0;
  position: relative;
}

.memory-card {
  width: 23%;
  height: auto;
  position: relative;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
  transform: scale(1);
  transform-style: preserve-3d; /*чтобы расположить их в трехмерном пространстве*/
  transition: transform 0.5s; /*чтобы создать эффект движения*/
}
.memory-card:active {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.front-face,
.back-face {
  width: 100%;
  height: 100%;
  padding: 20px;
  position: absolute;
  border-radius: 5px;
  background: var(--text-color);
  backface-visibility: hidden;
}
.front-face {
  transform: rotateY(180deg);
  background: none;
  border: 1px solid #c2cc54;
  box-shadow: var(--text-shadow);
}

.memory-card.flip {
  transform: rotateY(180deg); /* вращает карту на 180 градусов*/
}
/*--------------------*/
/*Модальное окно в начале */

.overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 8vh;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.modal-window {
  position: absolute;
  width: 30%;
  height: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  border: 1px solid #c2cc54;
  border-radius: 8px;
  box-shadow: var(--text-shadow);
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--text-color);
  font-size: 20px;
}

button {
  width: 50%;
  color: var(--text-color);
  background: black;
  border-radius: 5px;
  padding: 5px;
  border: 1px solid #c2cc54;
  transform: scale(1);
}
button:hover {
  box-shadow: var(--text-shadow);
}
button:active {
  transform: scale(0.95);
}

.overlay.hidden,
.modal-window.hidden {
  display: none;
}
/*--------------------*/
/*Модальное окно в конце */
.finish-window {
  display: none;
}
.finish-window.active {
  position: absolute;
  width: 40%;
  height: 70%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  border: 1px solid #c2cc54;
  border-radius: 8px;
  box-shadow: var(--text-shadow);
  color: var(--text-color);
  text-shadow: var(--text-shadow);
  font-size: 20px;
  background-color: rgba(0, 0, 0, 0.5);
}
.finish-window.active > div,
.play-again {
  padding: 5px 0;
}
h2 {
  text-transform: uppercase;
}
.record {
  text-align: center;
  line-height: 1.5;
}
/*--------------------*/
/*Таблица результатов */
.score-table {
  width: 100%;
  overflow: hidden;
}
table {
  width: 90%;
  margin: 0 auto;
  border-collapse: collapse; /* равномерные границы таблицы без дублирования */
}
tr {
  font-size: 1em;
}

td,
th {
  border: 1px solid #c2cc54;
  font-size: 0.8em;
  padding: 2px;
  text-align: center;
}
tr:nth-child(even) {
  background: rgba(194, 204, 84, 0.3);
}

/*--------------------*/
/*Подвал*/
#footer {
  height: 8vh;
  /* position: fixed; */
  margin: auto;
  display: flex;
  /* max-width: 1024px; */
  /* width: 100%; */
  /* bottom: calc(100% - (100%-50px)); */
  /* background-color: rgba(0, 0, 0, 0.3); */
  color: var(--text-color);
  text-shadow: var(--text-shadow);
  /* padding: 10px 0; */
  box-sizing: border-box;
  background: url(../images/bg.gif) no-repeat;
  background-size: cover;
  background-position: center center;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-content: center;
  flex-grow: 1;
}

.data,
.git-link,
.school-link {
  font-weight: bold;
  display: flex;
  align-items: center;
}

.git-link a {
  text-decoration: none;
  color: var(--text-color);
}
.git-link a > span:hover {
  box-shadow: var(--text-shadow);
}

.git-link span {
  padding-left: 5px;
}

.git-link img {
  width: 50px;
  filter: invert(45%) sepia(13%) saturate(1802%) hue-rotate(64deg)
    brightness(100%) contrast(81%);
  opacity: 0.9;
}
.git-link img:hover,
.school-link img:hover {
  opacity: 1;
}
.school-link img {
  width: 90px;
  filter: invert(58%) sepia(32%) saturate(643%) hue-rotate(55deg)
    brightness(97%) contrast(84%);
  opacity: 0.9;
}

.data,
.school-link {
  padding: 0 10px 0;
}

@media screen and (max-width: 768px) {
  body {
    font-size: 18px;
  }
  .git-link img {
    width: 40px;
  }
  .school-link img {
    width: 50px;
  }
  main {
    min-height: calc(100vh - 16vh);
  }
}
@media screen and (max-width: 600px) {
  .game {
    flex-basis: 100vw;
  }
  .modal-window {
    width: 80%;
  }
  .finish-window.active {
    width: 80%;
  }
}
@media screen and (max-width: 320px) {
  body {
    font-size: 16px;
  }
  .git-link img {
    width: 30px;
  }
  .school-link img {
    width: 40px;
  }
}
