* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: monospace;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: linear-gradient(
    to right top,
    #d16ba5,
    #c777b9,
    #ba83ca,
    #aa8fd8,
    #9a9ae1,
    #8aa7ec,
    #79b3f4,
    #69bff8,
    #52cffe,
    #41dfff,
    #46eefa,
    #5ffbf1
  );
  background: url(./image/img4.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  cursor: url(./image/cursor.png), auto;
}

.container {
  height: 680px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 40px 60px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(4px);
}

h2 {
  background-color: #cfd9df;
  border-radius: 16px;
  padding: 10px;
  margin: 5px;
  font-size: 3rem;
  color: black;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
}

.reset {
  padding: 15px 20px;
  color: black;
  background-color: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);
  border: none;
  border-radius: 16px;
  font-size: 2rem;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: url(./image/fing.png), auto;
}

.reset:focus {
  color: #fff;
  background-color: black;
}

.game {
  width: 430px;
  height: 430px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  transform-style: preserve-3d;
  perspective: 500px;
}
.item {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  font-size: 3em;
  transform: rotateY(180deg);
  transition: 0.25s;
  cursor: url(./image/fing.png), auto;
}
.item::after {
  content: "";
  position: absolute;
  background-color: lightblue;
  inset: 0;
  transition: 0.25s;
  transform: rotateY(0deg);
  backface-visibility: hidden;
}
.item.boxopen {
  transform: rotateY(0deg);
}
.boxopen:after,
.boxMatch:after {
  transform: rotateY(180deg);
}
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.loader {
  position: relative;
  top: 40%;
  left: 49%;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-screen p {
  margin-top: 10px;
  font-size: 18px;
  color: #333;
}
.loader-screen .loader,
p {
  position: relative;
  top: 40%;
  left: 47%;
}
@media (max-width: 768px) {
  .container {
    height: auto;
    padding: 20px;
  }
  h2 {
    font-size: 2rem;
  }
  .reset {
    font-size: 1.5rem;
  }
  .game {
    width: 100%;
    height: auto;
  }
  .item {
    width: 80px;
    height: 80px;
    font-size: 2em;
  }
  .loader {
    position: relative;
    top: 40%;
    left: 40%;
  }
  .loader-screen .loader,
  p {
    position: relative;
    top: 40%;
    left: 30%;
  }
}
