* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f0f2f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

header {
  margin: 20px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#score {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
}

#start {
  padding: 10px 30px;
  font-size: 1.2rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#start:hover {
  background-color: #45a049;
}

#span-conteiner {
  display: grid;
  /* יצירת גריד של 6 עמודות */
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 20px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card {
  background-color: #2c3e50; /* צבע גב הקלף */
  border-radius: 8px;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px; /* גודל קבוע ונוח */
  width: 100px;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.2s,
    background-color 0.2s;
  color: transparent; /* מסתיר את האמוג'י כשהקלף הפוך */
  text-shadow: none;
}

.card:hover {
  transform: scale(1.05);
}

/* מחלקה לכרטיס שנחשף */
.card.flipped {
  background-color: #ecf0f1;
  color: black;
  border: 2px solid #2c3e50;
  cursor: default;
}

/* מחלקה לכרטיס שנפתר */
.card.matched {
  background-color: #a8e6cf;
  color: black;
  animation: pop 0.3s ease-out;
}

/* מסך ניצחון */
#win {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#divMessage {
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  animation: dropIn 0.5s;
}

#divMessage h1 {
  font-size: 3rem;
  color: #2ecc71;
  margin-bottom: 10px;
}

#divMessage p {
  font-size: 1.5rem;
  color: #7f8c8d;
  cursor: pointer;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

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

/* התאמה למובייל */
@media (max-width: 700px) {
  #span-conteiner {
    grid-template-columns: repeat(5, 1fr); /* במובייל נרד ל-5 עמודות */
  }
  .card {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }
}
