/* --- General Page Styles --- */
.buttons {
  margin-bottom: 1em;
}

button {
  font-size: 1rem;
  padding: 0.5em 1em;
  cursor: pointer;
  margin: 0 0.25em;
}

/* Hide/unhide utility class */
.hidden {
  display: none !important;
}

/* 
   Each .card is absolutely positioned so we can move it
   around the entire page with translate().
*/
.card {
  position: absolute;
  width: 100px;
  height: 150px;
  perspective: 1000px; /* needed for 3D flips */
  /* This transition handles movement (translate/scale/etc.) */
  transition: transform 1s ease;
}

/* The wrapper for flipping front/back faces */
.card-transition {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

/* Card faces */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid white;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 3rem;
}

/* Front face is visible by default */
.front {
  background-color: darkgray;
  z-index: 2;
}

/* Back face is hidden by rotateY(180deg) */
.back {
  background: dimgray
    url('https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Generic_cardback.svg/300px-Generic_cardback.svg.png')
    center/cover no-repeat;
  transform: rotateY(180deg);
}

/* Flipping logic */
.card.flipped .card-transition {
  transform: rotateY(180deg);
}

/* Disable pointer events on the card while it's moving or locked */
.disabled-clicks {
  pointer-events: none;
}

.normal-cursor {
  cursor: default;
}

/* The initial "deck-position" = top-left corner, half-size, face-down. */
.deck-position {
  transform: translate(2.75rem, 1.75rem) scale(0.5) rotateY(180deg) !important;
}

/* 
   "offstage" means animating the card down off the screen
   near the same X as the deck, but large Y (e.g. 1200px).
   Adjust as needed for your viewport.
*/
.offstage {
  transform: translate(-150px, 400px) scale(0.25) !important; /* rotateY(180deg) */
}
