html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--light-colour);
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footerSection {
  width: 100%;
  height: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 2vmin;
  z-index: 1;
  position: absolute;
  bottom: 2.5vmin;
}

.animatedPanel {
  width: 100%;
  height: 100%;
  background-color: var(--dark-colour);
  position: absolute;
  z-index: 0;
  visibility: hidden;
  transform-origin: left;
}

.simpleButton {
  min-width: 10vw;
}

#stop-button {
  display: none;
}

#order-text {
  font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/*                                    CARDS                                   */
/* -------------------------------------------------------------------------- */

.cardCounter {
  border-radius: 1vmin;
  padding: 1vmin 2vmin;
}

.cardCounter p {
  font-size: 2vmin;
  user-select: none;
}

#cardNum {
  font-weight: 800;
}

.allCards {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#card-holder {
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-item {
  aspect-ratio: 3 / 2;
  min-width: 220px;
  min-height: 140px;
  max-height: 80vh;
  width: clamp(220px, 80vw, 1000px);
  padding: 1vmin 3vmin;
  background: var(--white-colour);
  border-radius: 1vmin;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 0.1vmin 0.2vmin,
    rgba(0, 0, 0, 0.3) 0px 0.35vmin 0.75vmin -0.15vmin,
    rgba(0, 0, 0, 0.2) 0px -0.15vmin 0px inset;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  text-wrap: balance;
}

.card-item p {
  font-size: 5vmin;
  text-align: center;
  color: var(--dark-colour);
}

@media (max-aspect-ratio: 1/1) {
  .card-item {
    aspect-ratio: 2 / 3;
    min-width: 90px;
    min-height: 120px;
    max-height: 85vh;
    max-height: 85svh;
  }
}

/* -------------------------------------------------------------------------- */
/*                               SET TIME LIMIT                               */
/* -------------------------------------------------------------------------- */

#set-time-modal {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--light-colour);
  align-items: center;
  justify-content: center;
}

#set-time-modal h1 {
  text-transform: uppercase;
  margin-bottom: 2vmin;
}

.modal-buttons {
  width: 100%;
  margin-top: 5vmin;
  display: flex;
  align-items: center;
  justify-content: center;
}

#time-picker {
  background-color: var(--white-colour);
  padding: 5vmin;
  border-radius: 1vmin;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 0.1vmin 0.2vmin,
    rgba(0, 0, 0, 0.3) 0px 0.35vmin 0.75vmin -0.15vmin,
    rgba(0, 0, 0, 0.2) 0px -0.15vmin 0px inset;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr min-content 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 1vmin 1.5vmin;
  justify-items: center;
  align-items: center;
  margin-bottom: 3vmin;
}

/* First row: Up buttons */
.time-grid > .time-up:nth-child(1) {
  grid-row: 1;
  grid-column: 1;
}
.time-grid > .time-up:nth-child(2) {
  grid-row: 1;
  grid-column: 2;
}
.time-grid > .colon:nth-child(3) {
  grid-row: 1;
  grid-column: 3;
}
.time-grid > .time-up:nth-child(4) {
  grid-row: 1;
  grid-column: 4;
}
.time-grid > .time-up:nth-child(5) {
  grid-row: 1;
  grid-column: 5;
}
/* Second row: Digits and colon */
.time-grid > .time-digit:nth-child(6) {
  grid-row: 2;
  grid-column: 1;
}
.time-grid > .time-digit:nth-child(7) {
  grid-row: 2;
  grid-column: 2;
}
.time-grid > .colon:nth-child(8) {
  grid-row: 2;
  grid-column: 3;
}
.time-grid > .time-digit:nth-child(9) {
  grid-row: 2;
  grid-column: 4;
}
.time-grid > .time-digit:nth-child(10) {
  grid-row: 2;
  grid-column: 5;
}
/* Third row: Down buttons */
.time-grid > .time-down:nth-child(11) {
  grid-row: 3;
  grid-column: 1;
}
.time-grid > .time-down:nth-child(12) {
  grid-row: 3;
  grid-column: 2;
}
.time-grid > .colon:nth-child(13) {
  grid-row: 3;
  grid-column: 3;
}
.time-grid > .time-down:nth-child(14) {
  grid-row: 3;
  grid-column: 4;
}
.time-grid > .time-down:nth-child(15) {
  grid-row: 3;
  grid-column: 5;
}

.time-digit {
  width: 10vmin;
  text-align: center;
  font-weight: 800;
  font-size: 10vmin;
  color: var(--dark-colour);
  background-color: var(--white-colour);
  border-radius: 1vmin;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 0.1vmin 0.2vmin,
    rgba(0, 0, 0, 0.3) 0px 0.35vmin 0.75vmin -0.15vmin,
    rgba(0, 0, 0, 0.2) 0px -0.15vmin 0px inset;
}

.colon {
  font-weight: 800;
  font-size: 5vmin;
  color: var(--dark-colour);
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/*                                 ANIMATIONS                                 */
/* -------------------------------------------------------------------------- */

.wobble-vertical-left {
  animation: wobble-vertical-left 0.8s linear both;
}
@keyframes wobble-vertical-left {
  0%,
  100% {
    transform: translateY(0) rotate(0);
    transform-origin: 50% 50%;
  }
  15% {
    transform: translateY(-30px) rotate(-6deg);
  }
  30% {
    transform: translateY(15px) rotate(6deg);
  }
  45% {
    transform: translateY(-15px) rotate(-3.6deg);
  }
  60% {
    transform: translateY(9px) rotate(2.4deg);
  }
  75% {
    transform: translateY(-6px) rotate(-1.2deg);
  }
}

.wobble-vertical-right {
  animation: wobble-vertical-right 0.8s linear both;
}
@keyframes wobble-vertical-right {
  0%,
  100% {
    transform: translateY(0) rotate(0);
    transform-origin: 50% 50%;
  }
  15% {
    transform: translateY(-30px) rotate(6deg);
  }
  30% {
    transform: translateY(15px) rotate(-6deg);
  }
  45% {
    transform: translateY(-15px) rotate(3.6deg);
  }
  60% {
    transform: translateY(9px) rotate(-2.4deg);
  }
  75% {
    transform: translateY(-6px) rotate(1.2deg);
  }
}
