/* Style the page below here */
section,
header {
  display: flex;
  justify-content: center;
}

@import url(https://fonts.google.com/specimen/DM+Sans);

html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
    background: linear-gradient( rgba(255, 0, 0, 0.5), rgba(255, 0, 0, 0.9) ), url('images/leaves.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
    font-weight: bold;
}

header {
  border-radius: 1vw;
  color: white;
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  text-align: center;
}

/* Style the buttons below here */

.button-box {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 4vw;
}

.shuffle-draw-class {
  /* General location/size characteristics */
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 10vw;
  height: 10vh;
  min-height: 75px;

  /* Customizing the button properties here */
  border-radius: 0.5rem;
  box-shadow: 0.05rem 0.2rem 0rem rgb(83, 18, 18);
}

.shuffle-draw-class img {
  height: 10vh;
}

.shuffle-draw-class:hover {
  cursor: pointer;
  box-shadow: 0.1rem 0.4rem 0.2rem rgb(83, 18, 18);
  transition: box-shadow 0.25s ease;
}

.shuffle-draw-class:active {
  cursor: pointer;
  box-shadow: 0rem 0rem 0rem rgb(83, 18, 18);
  transition: box-shadow 0.01s ease;
}

/* Style the cards below here */

.no-card {
  background-color: #b83939;
  background-size: cover;
  background-position: center;
}

.back-card {
  background-color: #b83939;
  background-image: url(images/card-background.png);
  background-size: cover;
  background-position: center;
}

.card-front {
  background-color: #ffffff;
}

.no-card,
.back-card,
.card-front {
  width: 12vw;
  margin: 1vw;
  height: 36vh;
  min-height: 400px;
  min-width: 200px;
  border-radius: 1vw;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.card-front p {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  color: #ae4040;
  position: relative;
}

.card-grid {
  display: grid;
  grid-template-rows: 1fr 1fr; /* Two rows: one for the number, one for the suit */
  grid-template-columns: 1fr; /* Single column */
  justify-items: center; /* Center items horizontally */
  align-items: center; /* Center items vertically */
  height: 100%; /* Ensure it fills the card */
}
.number-container {
  font-size: calc(50px + 7vw);
  letter-spacing: -0.2em;
  position: relative;
  right: 2.5vw;
  grid-row: 1; /* Place in the first row */
}
.suit-container {
  font-size: calc(50px + 5vw);
  height: auto;
  position: relative;
  bottom: 1vw;
  left: 1vw;
  grid-row: 2; /* Place in the second row */
}

@media (max-width: 1600px) {
  .no-card,
  .back-card,
  .card-front {
    width: 12rem;
    height: 18rem;
    max-width: 200px;
    max-height: 300px;
    min-width: 0px;
    min-height: 300px;
  }

  .number-container {
    font-size: 8rem;
  }

  .suit-container {
    font-size: 7rem;
  }

  .shuffle-draw-class {
    min-width: 150px;
  }

  .button-box {
    gap: 1.5em;
  }
}

/* Animation for drawing and flipping a card */
@keyframes draw-flip-card {
  0% {
    transform: translateX(-10vw) rotateY(180deg);
  }
  100% {
    transform: translateX(0vw) rotateY(0deg);
  }
}

.animate-draw-flip {
  animation: draw-flip-card 0.1s ease;
  transform-origin: center;
  perspective: 1000px;
}

/* Animation for shuffling the deck */
@keyframes shuffle-deck {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(-1vw) rotate(-5deg);
  }
  50% {
    transform: translateX(1vw) rotate(5deg);
  }
  75% {
    transform: translateX(-0.5vw) rotate(-3deg);
  }
  100% {
    transform: translateX(0) rotate(0deg);
  }
}

.animate-shuffle {
  animation: shuffle-deck 0.6s ease-in-out infinite;
}