.flashcards-stack {
  position: relative;
  width: 300px;
  height: 200px;
  margin: 50px auto;
}

.flashcard {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  cursor: pointer;
  transition: all 0.4s ease;
  transform: 
    translate(calc(var(--i) * 8px), calc(var(--i) * 8px)) 
    rotate(calc(var(--i) * 2deg));
  opacity: calc(1 - (var(--i) * 0.2));
  z-index: calc(100 - var(--i));
}

.flashcard.active {
  opacity: 1;
  transform: translate(0, 0) rotate(0deg);
  z-index: 1000;
  visibility: visible;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard-inner.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.flashcard-front {
  background-color: var(--bg-color, #7f8c8d);
  color: white;
}

.flashcard-back {
  background-color: #2ecc71;
  color: white;
  transform: rotateY(180deg);
}
