.memory-card-game {
  text-align: center;
  padding: 2rem;
}

.memory-card-game h1 {
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.game-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0 auto 1rem;
  flex-wrap: wrap;
}

.score-container {
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
}

.score-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--text-muted-color);
  margin-bottom: 0.25rem;
}

.moves, .pairs {
  font-size: 1.5rem;
  font-weight: bold;
}

.reset-button, .retry-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.reset-button:hover, .retry-button:hover {
  opacity: 0.8;
}

.instructions {
  max-width: 500px;
  margin: 0 auto 2rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted-color);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  gap: 15px;
  max-width: 540px;
  margin: 0 auto;
  perspective: 1000px;
}

.card {
  width: 120px;
  height: 120px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

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

.card.matched {
  opacity: 0.6;
  cursor: default;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  border: 2px solid var(--card-border-color);
}

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

.card-back {
  background: linear-gradient(135deg, var(--link-color) 0%, #667eea 100%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
}

.card-back::after {
  content: '?';
}

.game-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.game-message.hidden {
  display: none;
}

.game-message p {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.final-moves {
  font-size: 2rem;
  color: var(--link-color);
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(4, 80px);
    gap: 10px;
    max-width: 360px;
  }

  .card {
    width: 80px;
    height: 80px;
  }

  .card-face {
    font-size: 2.5rem;
  }

  .card-back {
    font-size: 1.5rem;
  }
}
