.table[data-opponents] {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr);
  grid-template-areas:
    ". seat-a seat-a seat-b seat-b ."
    ". trick trick trick trick ."
    ". bottom bottom bottom bottom .";
  align-items: start;
  gap: 12px;
  height: auto;
  min-height: 420px;
  padding: 18px 5% 42px;
  border-radius: 44% / 28%;
}

.table[data-opponents="3"] {
  grid-template-areas:
    "seat-a . seat-b seat-b . seat-c"
    "seat-a trick trick trick trick seat-c"
    ". bottom bottom bottom bottom .";
}

.table[data-opponents="4"] {
  grid-template-areas:
    "seat-a seat-b seat-b seat-c seat-c seat-d"
    "seat-a trick trick trick trick seat-d"
    ". bottom bottom bottom bottom .";
}

.table > .opponents { display: contents; }
.table .opponent {
  position: relative;
  width: 100%;
  min-width: 0;
  transform: none;
}
.table .seat-0 { grid-area: seat-a; }
.table .seat-1 { grid-area: seat-b; }
.table .seat-2 { grid-area: seat-c; }
.table .seat-3 { grid-area: seat-d; }
.table .seat-0, .table .seat-3, .table[data-opponents="3"] .seat-2 { align-self: end; }
.table .opponent-characters { margin-bottom: 2px; }
.table .mini-character { width: 24px; height: 33px; }
.table .opponent-hand {
  transform: scale(.72);
  transform-origin: top center;
  height: 54px;
  margin: 0 0 0 calc((100% - 190px) / 2);
}
.table .opponent-label { margin: 2px 0 6px; }
.table .live-center {
  grid-area: trick;
  position: static;
  align-self: center;
  padding: 10px 0;
}
.table .live-center #table-message { max-height: none; overflow: visible; }
.table .bottom-seat {
  grid-area: bottom;
  min-width: 0;
  text-align: center;
  align-self: end;
}
.table .bottom-seat .opponent-label { margin: 4px 0 0; }
.table .table-note { bottom: 16px; }

.stack-scroll {
  overflow: auto hidden;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #aa9966 transparent;
}
.stack-scroll:focus-visible {
  outline: 2px solid #e5c884;
  outline-offset: -2px;
}
.played-stack {
  --played-card-width: 62px;
  display: flex;
  width: max-content;
  list-style: none;
  margin: 0 auto;
  padding: 4px 4px 22px;
}
.played-stack:has(.pool-card:only-child) { padding-bottom: 6px; }
.played-stack .pool-card {
  position: relative;
  isolation: isolate;
  top: var(--cascade-y);
  display: block;
  width: var(--played-card-width);
  min-width: var(--played-card-width);
  height: 72px;
  min-height: 0;
  padding: 5px;
  border-radius: 5px;
  box-shadow: -2px 2px 5px #07171255;
}
.played-stack .pool-card + .pool-card { margin-left: calc(30px - var(--played-card-width)); }
.played-stack .latest-play {
  box-shadow: -2px 3px 6px #07171288;
}
.played-stack .played-index {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 17px;
  gap: 3px;
}
.played-stack .played-index strong { font-size: 17px; line-height: 1; }
.played-stack .played-index small { font: 8px/1 Arial, sans-serif; white-space: nowrap; }
.played-stack .played-emblem {
  position: absolute;
  bottom: 9px;
  right: 7px;
  width: 27px;
  height: 27px;
  opacity: .75;
}
.played-stack .pool-hidden {
  background: repeating-linear-gradient(45deg, transparent 0 4px, #c7b77d16 4px 5px), #192c26;
}
.played-stack .played-back-mark {
  position: absolute;
  top: 19px;
  left: 5px;
  width: 22px;
  height: 24px;
  fill: currentColor;
  stroke: none;
}
.empty-stack {
  margin: 8px 0;
  color: #aab799;
  font: 12px/1.3 Arial, sans-serif;
}

@media (max-width: 800px) {
  .table[data-opponents] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "seat-a seat-b" "trick trick" "bottom bottom";
    gap: 10px;
    padding: 15px 4% 38px;
    border-radius: 20% / 10%;
  }
  .table[data-opponents="3"] {
    grid-template-areas: "seat-b seat-b" "seat-a seat-c" "trick trick" "bottom bottom";
  }
  .table[data-opponents="4"] {
    grid-template-areas: "seat-b seat-c" "seat-a seat-d" "trick trick" "bottom bottom";
  }
  .table .opponent-hand {
    height: 46px;
    transform: scale(.59);
  }
  .table .live-center { padding: 7px 0; }
}
