/* Import Google Font - Poppins */
@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;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #6563FF;
}
.wrapper{
  padding: 25px;
  border-radius: 10px;
  background: #F8F8F8;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
}

/* Stats Display */
.stats{
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label{
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

.stat-value{
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.cards, .card, .view{
  display: flex;
  align-items: center;
  justify-content: center;
}
.cards{
  height: 400px;
  width: 400px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.cards .card{
  cursor: pointer;
  list-style: none;
  user-select: none;
  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);
  }
}
.card .view{
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 7px;
  background: #fff;
  pointer-events: none;
  backface-visibility: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.25s linear;
}
.card .front-view img{
  width: 19px;
}
.card .back-view img{
  max-width: 45px;
}
.card .back-view{
  transform: rotateY(-180deg);
}
.card.flip .back-view{
  transform: rotateY(0);
}
.card.flip .front-view{
  transform: rotateY(180deg);
}

@media screen and (max-width: 700px) {
  .cards{
    height: 350px;
    width: 350px;
  }
  .card .front-view img{
    width: 17px;
  }
  .card .back-view img{
    max-width: 40px;
  }
}

@media screen and (max-width: 530px) {
  .cards{
    height: 300px;
    width: 300px;
  }
  .card .front-view img{
    width: 15px;
  }
  .card .back-view img{
    max-width: 35px;
  }
  .stats{
    padding: 10px;
  }
  .stat-label{
    font-size: 10px;
  }
  .stat-value{
    font-size: 16px;
  }
}

/* Game Over Modal */
.game-over{
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.game-over.show{
  display: flex;
}

.game-over-content{
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from{
    transform: translateY(-50px);
    opacity: 0;
  }
  to{
    transform: translateY(0);
    opacity: 1;
  }
}

.game-over-content h2{
  font-size: 32px;
  color: #fff;
  margin-bottom: 10px;
}

.complete-msg{
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  margin-bottom: 25px;
}

.final-stats{
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
}

.final-stat{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.final-stat:last-child{
  border-bottom: none;
}

.final-stat.highlight{
  background: rgba(255,255,255,0.15);
  margin: 10px -10px -10px;
  padding: 15px 10px;
  border-radius: 10px;
  border-bottom: none;
}

.final-label{
  font-size: 16px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.final-value{
  font-size: 24px;
  color: #fff;
  font-weight: 700;
}

.buttons{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn{
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 140px;
}

.btn-primary{
  background: #fff;
  color: #6563FF;
}

.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255,255,255,0.3);
}

.btn-secondary{
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover{
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}