*{
    margin: 0;
    padding: 0;
}
body {
  text-align: center;
  font-family: Arial, sans-serif;
  background: #212121;;
  margin: 0;
  padding: 10px;
}

h1 {
  color: #fff;
  font-size: 30px;
}

/* Score & Timer */
#scoreBoard, #timer {
  font-size: 18px;
  margin: 5px;
  color: #fff;
  font-weight: bold;
}


#startBtn {
  padding: 10px 20px;
   background: linear-gradient(
        200deg,
        #fef838,
        #6fc4f8,
        #34e9bf,
        #49e0ee
    );
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 10px;
  font-size: 16px;
}

.game-board {
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 10px;
  pointer-events: none; 
}

/* Card */
.card {
  aspect-ratio: 1 / 1; /* always square */
  background: #333;
  box-shadow: 0 0 10px white;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 6vw, 32px); /* responsive font size */
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.5s, background 0.3s;
  transform-style: preserve-3d;
}

.flipped {
  background:  linear-gradient(
        200deg,
        #abfe38,
        #6ff8ad,
        #43e934,
        #5fee49
    );
  color: white;
  transform: rotateY(180deg);
}

.matched {
  background: linear-gradient(
        200deg,
        #fe5f38,
        #f36565,
        #e98834,
        #ee49ee
    );
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.2); }
  50%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Popup */
.popup {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: none; 
  align-items: center; 
  justify-content: center;
  padding: 10px;
}
.popup-content {
  background: #333;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
}
.popup button {
  margin-top: 15px;
  padding: 8px 16px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.popup button:hover { 
  background: #d32f2f;
 }

/* Media Queries for extra responsiveness */
@media (max-width: 500px) {
  h1 { 
    font-size: 20px;
   }
  #scoreBoard, #timer { 
    font-size: 16px;
   }
}