p{
  font-size: 20px;
}

.wrapper-memory {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: fit-content;
}
::selection{
  color: #fff;
  background: #6563ff;
}
.cards, .card, .view, .details, p{
  display: flex;
  align-items: center;
  justify-content: center;
}
.cards {
    height: 500px;
    width: 500px;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0px;
    margin: 0px;
}
.cards .card{
  cursor: pointer;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  height: calc(100% / 4 - 10px);
  width: calc(100% / 4 - 10px);
}
.card.shake{
  animation: shake 0.35s ease-in-out;
}
@keyframes shake {
  0%, 100%{
    transform: translateX(0);
  }
  20%{
    transform: translateX(-13px);
  }
  40%{
    transform: translateX(13px);
  }
  60%{
    transform: translateX(-8px);
  }
  80%{
    transform: translateX(8px);
  }
}
.cards .card .view{
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
  position: absolute;
  background: #fff;
  border-radius: 7px;
  backface-visibility: hidden;
  transition: transform 0.25s linear;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.card .front-view img {
    max-width: 30px;
	margin: 0px;
}
.card .back-view{
  transform: rotateY(-180deg);
}
.card .back-view img{
  max-width: 80px;
	margin: 0px;
}
.card.flip .front-view{
  transform: rotateY(180deg);
}
.card.flip .back-view{
  transform: rotateY(0);
}

.details {
    width: 100%;
    margin-top: 14px;
    padding: 0 20px;
    border-radius: 6px;
    background: #fff;
    height: calc(100% / 4 - 30px);
    justify-content: space-between;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    align-items: center;
}
.details p {
    font-size: 16px;
    height: 50px;
    padding-right: 18px;
    border-right: 1px solid #ccc;
    margin: 0px;
}
.details p span{
  margin-left: 8px;
}
.details p b{
  font-weight: 500;
}
.details button {
    cursor: pointer;
    font-size: 14px;
    color: #3d4b88;
    border-radius: 4px;
    padding: 8px 30px;
    background: #fff;
    border: 2px solid #3d4b88;
    transition: 0.3s ease;
    font-weight: 600;
}
.details button:hover{
  color: #fff;
  background: #3d4b88;
}

@media screen and (max-width: 1200px) {
	.details p {
		font-size: 14px;
		height: 30px;
		margin: 0px;
		width: fit-content;
	}
}


@media screen and (max-width: 700px) {
  .cards{
    height: 500px;
    width: 100%;
  }
  .card .front-view img{
    max-width: 30px;
  }
  .card .back-view img{
    max-width: 70px;
  }
}

@media screen and (max-width: 530px) {
	.wrapper-memory {
		align-items: baseline;
		height: 690px;
	}
	.cards .card {
		height: calc(100% / 3 - 10px);
		width: calc(100% / 3 - 7px);
	}
	.cards {
		height: 350px;
		width: 100%;
		gap: 10px;
	}
  .card .back-view img{
    max-width: 80px;
  }
  .details {
    margin-top: 10px;
    padding: 0 15px;
    height: calc(100% / 4 - 20px);
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    padding: 20px;
	}
  .details p {
    height: 15px;
    font-size: 17px;
    padding-right: 0px;
	border-right: none;
  }
	.details button {
		font-size: 16px;
		padding: 5px 10px;
		border: none;
		color: #fff;
		background: #3d4b88;
	}
}

@media screen and (max-width: 390px){
	.card .back-view img{
		max-width: 60px;
	}
}

/* Добавим класс для блокировки прокрутки */
body.no-scroll {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 110;
}

.modal-content {
    background: white;
    padding: 50px 20px 30px 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
    width: 300px;
    position: relative;
}

.modal-btn {
    display: inline-block;
    margin-top: 0px;
    padding: 12px 30px;
    background: #3D4B88;
    color: white;
	cursor: pointer;
    text-decoration: none;
    border-radius: 5px;
}

.modal-close {
    display: block;
    margin-top: 0px;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    right: 20px;
    top: 20px;
    position: absolute;
}

.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}