.poker-table {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: 100%;
}

/* With more than the dealer, everyone sits round an oval table: felt inside a padded wooden
   rail, the same in both themes. */
.poker-table:not([data-opponents="1"]) {
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  border: 0.7rem solid #4a2e17;
  border-radius: 50% / 9rem;
  background: radial-gradient(ellipse at 50% 45%, var(--felt-light), var(--felt) 60%, var(--felt-dark));
  box-shadow:
    inset 0 0 0 2px rgb(233 196 96 / 0.55),
    inset 0 0.75rem 2rem rgb(0 0 0 / 0.35),
    0 0 0 2px #2c1a0b,
    0 1rem 1.5rem -0.75rem rgb(0 0 0 / 0.7);
}

/* Where the seats fit in one row, the outer ones sit lower, following the curve of the rail. */
@media (min-width: 60rem) {
  .poker-table:is([data-opponents="3"], [data-opponents="4"]) .poker-seat[data-seat="0"],
  .poker-table[data-opponents="3"] .poker-seat[data-seat="2"],
  .poker-table[data-opponents="4"] .poker-seat[data-seat="3"] {
    transform: translateY(1.25rem);
  }

  .poker-table:is([data-opponents="3"], [data-opponents="4"]) #board {
    margin-top: 1.25rem;
  }
}

.poker-opponents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
}

.poker-seat {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}

.poker-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.poker-hand {
  color: var(--ink);
}

.poker-hand[data-tone="win"] {
  color: var(--win);
}

.poker-hand[data-tone="loss"] {
  color: var(--loss);
}

.poker-cards {
  display: flex;
  gap: clamp(0.3rem, 1.5vw, 0.6rem);
}

/* An empty spot is a faint outline on the felt until a card lands on it. */
.poker-card {
  display: grid;
  place-items: center;
  width: clamp(2.6rem, 11vw, 4rem);
  aspect-ratio: 5 / 7;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-family: var(--display);
  font-size: clamp(1rem, 4.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1;
}

/* Ivory card stock, the same in both themes. */
.poker-card[data-state="up"] {
  border: 0;
  background: #f8f4e9;
  box-shadow: 0 4px 10px -4px rgb(0 0 0 / 0.6);
  color: #14201a;
  animation: card-in 0.2s ease-out;
}

.poker-card[data-red="true"] {
  color: #c62a41;
}

.poker-card[data-state="down"] {
  border: 3px solid #f8f4e9;
  background: repeating-linear-gradient(45deg, var(--chip-red) 0 4px, #a8253b 4px 8px);
  box-shadow: 0 4px 10px -4px rgb(0 0 0 / 0.6);
  animation: card-in 0.2s ease-out;
}

@keyframes card-in {
  from {
    transform: translateY(-0.75rem) scale(0.9);
    opacity: 0;
  }
}

/* Smaller cards for a full table, so the seats still fit side by side. */
.poker-table:is([data-opponents="3"], [data-opponents="4"]) .poker-opponents .poker-card {
  width: clamp(2.2rem, 8vw, 3.2rem);
  font-size: clamp(0.875rem, 3.5vw, 1.2rem);
}

.poker-table.folded #player .poker-card {
  opacity: 0.45;
}

.poker-pays {
  width: min(100%, 26rem);
  font-size: 0.875rem;
}

.poker-pays p {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-weight: 600;
}

.poker-pays ul {
  display: grid;
  gap: 0.15rem;
}

.poker-pays li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .poker-card {
    animation: none !important;
  }
}
