@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;
}

/* Navbar Styling */
.navbar {
  width: 100%;
  background-color: #4b54fcd1;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.game-title {
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
}

/* Body & Wrapper */
body{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #6766b53a;
  flex-direction: column;
  padding-top: 80px; /* Space for navbar */
}

.wrapper{
  padding: 25px;
  border-radius: 10px;
  background: #F8F8F8;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.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);
}

/* Responsive adjustments */
@media screen and (max-width: 700px) {
  .cards{
    height: 350px;
    width: 350px;
  }
  .game-title {
    font-size: 1.4rem;
  }
}

@media screen and (max-width: 530px) {
  .cards{
    height: 300px;
    width: 300px;
  }
  .game-title {
    font-size: 1.2rem;
  }
}

/* ========================= */
/* POPUP Game Finish*/

/* .game-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(255, 255, 255);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.game-popup.show {
    display: block;
}

.game-popup button {
    margin-top: 10px;
    padding: 8px 15px;
    cursor: pointer;
} */
.game-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(145deg, #ffffff, #f4f4f4);
    padding: 25px 30px;
    text-align: center;
    border-radius: 15px;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 10;
    animation: popupFade 0.3s ease forwards;
}

.game-popup.show {
    display: block;
}

@keyframes popupFade {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup-message {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a4a4a;
    margin-bottom: 15px;
}

.game-popup button {
    background: #6c63ff;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.game-popup button:hover {
    background: #5848e8;
}
