* {
  box-sizing: border-box;
  /* font-family: "Comic Sans MS", Arial, sans-serif; */
}

body {
  background: linear-gradient(180deg, #87ceeb, #fff);
}

.card-stack-wrapper {
  width: 320px;
  height: 420px;
  perspective: 1400px;
}

.card-stack {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.stack-card {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 30px 55px rgba(0, 0, 0, 0.35),
    inset 0 0 0 6px rgba(255, 255, 255, 0.8);
  background-size: cover;
  background-position: center;
  transform-origin: center;
  will-change: transform, opacity, filter;
  cursor: pointer;
}

.stack-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      120% 120% at 0% 0%,
      rgba(84, 160, 255, 0.35) 0%,
      rgba(117, 77, 255, 0.3) 45%,
      rgba(255, 255, 255, 0) 70%
    ),
    linear-gradient(
      135deg,
      rgba(118, 160, 255, 0.25),
      rgba(255, 255, 255, 0) 60%
    );
  pointer-events: none;
}

.stack-card .label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: #1f2a44;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.scene {
  width: 280px;
  height: 360px;
  perspective: 1400px;
}

.flip_card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  border-radius: 26px;
}

.flip_card::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 32px;
  background: linear-gradient(135deg, #ff9800, #ffeb3b, #4caf50);
  z-index: -1;
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  backface-visibility: hidden;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35), inset 0 0 0 6px #fff;
}

.face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  padding: 0;
}

.face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.05) 40%,
    transparent 60%
  );
}

.back {
  transform: rotateY(180deg);
}

.controls {
  display: flex;
  gap: 14px;
}

.flip-button {
  padding: 12px 22px;
  font-size: 16px;
  border: none;
  border-radius: 26px;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.prev {
  background: linear-gradient(135deg, #3f51b5, #5c6bc0);
}

.shuffle {
  background: linear-gradient(135deg, #9c27b0, #e040fb);
}

.next {
  background: linear-gradient(135deg, #ff5722, #ff9800);
}

.flip-button:active {
  transform: scale(0.95);
}
