.hand {
  position: relative;
  margin-top: 10px;
  --hand-floor-offset: clamp(12px, 2vh, 24px);
}

.hand.me {
  height: 260px;
}

.hand.enemy {
  height: 170px;
}

.hand .card,
.hand button.card {
  position: absolute;
  left: 50%;
  bottom: var(--hand-floor-offset);
  transform-origin: bottom center;
  transition: transform .14s ease, box-shadow .14s ease;
}

.hand.me .card:hover,
.hand.me button.card:hover {
  transform: translateX(var(--x, 0px)) rotate(var(--angle, 0deg)) translateY(-16px) scale(1.04);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.card {
  --card-fill: linear-gradient(150deg, #ff4e54, var(--uno-red));
  width: 96px;
  height: 144px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  z-index: 0;
  font-size: 2.3rem;
  text-align: center;
  line-height: 1;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.45), 1px -1px 0 rgba(0, 0, 0, 0.45), -1px 1px 0 rgba(0, 0, 0, 0.45), 1px 1px 0 rgba(0, 0, 0, 0.45);
}

.card::before {
  z-index: -2;
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  background: var(--card-fill);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.4), inset 0 12px 28px rgba(0, 0, 0, 0.25);
}

.card::after {
  z-index: -1;
  content: "";
  position: absolute;
  width: 170%;
  height: 140%;
  top: -22%;
  left: -38%;
  border-radius: 50% / 70%;
  background:
    radial-gradient(80% 30% at 50% 54%, rgba(94, 13, 13, 0) 0 56%, rgb(255, 255, 255) 58% 66%, rgba(255, 255, 255, 0) 70% 100%);
  transform: rotate(-45deg);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.card>* {
  position: relative;
  z-index: 1;
}

.card.small {
  width: 72px;
  height: 108px;
  font-size: 1rem;
  border-radius: 14px;
}

.card.placeholder {
  --card-fill: linear-gradient(150deg, #4a4d59, #111216);

  background:
    radial-gradient(80% 30% at 50% 50%, rgb(173, 19, 19) 0 56%, rgba(255, 255, 255, 0.9) 58% 66%, rgb(0, 0, 0) 70% 100%);
  color: #b9bed1;
  box-shadow: inset 0 0 0 2px rgb(255, 255, 255);
    text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);

}

.card.placeholder::before,
.card.placeholder::after {
  display: none;
}

.card.red {
  --card-fill: linear-gradient(150deg, #ff4e54, var(--uno-red));
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);

}

.card.yellow {
  --card-fill: linear-gradient(150deg, #ffe76c, var(--uno-yellow));
  color: #ffffff;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.card.green {
  --card-fill: linear-gradient(150deg, #32d889, var(--uno-green));
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);

}

.card.blue {
  --card-fill: linear-gradient(150deg, #37a6ff, var(--uno-blue));
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);

}

.card.black {
  --card-fill: linear-gradient(150deg, #4a4d59, #111216);
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.badge {
  font-size: .8rem;
  color: #cfd4e6;
}

.turn {
  outline: 2px dashed rgba(255, 255, 255, 0.35);
  outline-offset: 6px;
}
@media (max-width: 720px) {
  .hand {
    --hand-floor-offset: clamp(8px, 1.4vh, 16px);
  }

  .hand.me {
    height: 190px;
  }

  .hand.enemy {
    height: 120px;
  }

  .card {
    width: 70px;
    height: 108px;
    border-radius: 14px;
    font-size: 1.6rem;
  }

  .card.small {
    width: 48px;
    height: 82px;
    font-size: 0.8rem;
  }
}

