body {
  background: #ffffff url("./assets/images/geometry2.png");
  font-family: "Coda", cursive;
}
.score-panel {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font: 18px/1.5 'Acme', sans-serif;
}

.restart {
    float: right;
    cursor: pointer;
}
.restart .fa{
  font-size: larger;
}
.memory-card.flipped .card-inner {   
  transform: rotateY(180deg);
}

.card-front {
  transform: rotateY(180deg);
}

.memory-card.matched {   
  cursor: default;
  opacity: 0.8;
  transform: scale(0.98);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%; 
  max-width: 660px; 
  margin: 0 auto; 
  min-height: 680px;
  background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
  padding: 32px;
  border-radius: 10px;
  box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
}

@media (max-width: 520px) {
  .memory-grid {
    gap: 8px; 
    padding: 16px; 
    min-height: auto; 
  }
    .memory-card {
    height: auto; 
    min-height: 80px; 
  }
}

.restart {
  float: none; 
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px; 
}

.restart .fa {
  font-size: 1.2rem; 
}

.memory-card.flipped .card-inner {   
  transform: rotateY(180deg);
}

.card-front {
  transform: rotateY(180deg);
}

.memory-card.matched {   
  cursor: default;
  opacity: 0.8;
  transform: scale(0.98);
}

.memory-card {
  position: relative;
  width: 100%;
  padding-top: 100%; 
  perspective: 1000px;
  cursor: pointer;
  height: auto; 
  background: #2e3d49;
  font-size: 0;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
  transition: all 0.3s ease-in-out;
  transform: scale3d(1, 1, 1) rotateZ(0deg);
}

.card-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
}

.card-front img,
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-back img {
  object-fit: cover;
}

/* Modal Styles*/
.modal {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(49, 49, 49, 0.7);
  z-index: 1000; 
}

.modal-box {
  position: fixed;
  background-color: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; 
  max-width: 625px;
  padding: 40px;
  text-align: center;
  border-radius: 5px;
}

.modal-box h1 {
  margin: 0 0 20px 0;
  font-size: 2em;
}

.btn-modal {
  color: #f3f7f7;
  background-color: #028de4;
  width: 120px;
  height: 30px;
  border: 1px solid #e9edef;
  border-radius: 5px;
  box-shadow: 1px 2px 4px rgba(235, 235, 235, 0.48);
  font-size: 1em;
  cursor: pointer;
}

.btn-modal:hover {
  background-color: #f3f7f7;
  color: #028de4;
  transition: all 0.5s ease;
}