/* Public score piles, a quiet timeline, and personal seats. */
#settings-friends {
  flex-wrap: wrap;
}
#settings-friends button {
  flex: 1 0 28%;
}
.call-fields[data-many="true"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(240px, 35dvh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 2px;
}
.call-fields[data-many="true"] .call-selects select {
  flex: 1;
  width: 0;
}
#secret-content {
  min-width: 0;
  max-height: 100px;
  overflow: auto;
  scrollbar-width: thin;
}
.seat[data-relation="ally"] {
  --camp: #70c98c;
  --camp-ring: #70c98c35;
}
.seat[data-relation="opponent"] {
  --camp: #e48279;
  --camp-ring: #e4827935;
}
.seat[data-relation="unknown"] {
  --camp: #cdd2ca;
  --camp-ring: #cdd2ca22;
}
.seat[data-relation] .seat-avatar {
  pointer-events: auto;
  border: 2px solid var(--camp);
  box-shadow:
    0 0 0 2px var(--camp-ring),
    0 3px 10px #0a1e1544;
}
.seat[data-relation].active .seat-avatar {
  outline: 1px solid #f4edcebb;
  outline-offset: 4px;
}
.play-cluster.leading .mini-hand {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}
.play-cluster.leading > small {
  color: var(--gold);
}
.table-view {
  --trump-accent: #cad2ce;
  --trump-wash: #cad2ce00;
}
.table-view[data-trump="S"] {
  --trump-accent: #abc8df;
  --trump-wash: #87b7de12;
}
.table-view[data-trump="H"] {
  --trump-accent: #e0aea5;
  --trump-wash: #ce796014;
}
.table-view[data-trump="C"] {
  --trump-accent: #c6badb;
  --trump-wash: #ad92d212;
}
.table-view[data-trump="D"] {
  --trump-accent: #e0c48d;
  --trump-wash: #d9b66112;
}
.table-view[data-trump="NT"] {
  --trump-accent: #d7dedc;
  --trump-wash: #b8cac714;
}
.table-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.trump-indicator {
  padding: 7px 10px;
  color: var(--trump-accent);
  border: 1px solid var(--trump-accent);
  background: var(--trump-wash);
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  justify-self: start;
}
.table-view[data-trump="pending"] .trump-indicator {
  opacity: 0.55;
  border-style: dashed;
}
.table-view .arena {
  background-image: radial-gradient(
    ellipse,
    var(--trump-wash),
    transparent 70%
  );
}
.table-view:not([data-trump="pending"]) .felt-lettering {
  color: var(--trump-accent);
  opacity: 0.09;
}
.table-view:not([data-trump="pending"]) #trump-watermark {
  font:
    clamp(100px, 14vw, 160px) Georgia,
    "Songti SC",
    serif;
  letter-spacing: 8px;
}
@media (max-width: 800px) {
  .table-topline {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .table-topline .rules-line {
    grid-column: 1 / -1;
  }
  .table-topline .compact-score {
    justify-self: end;
  }
  .call-fields[data-many="true"] {
    grid-template-columns: minmax(0, 1fr);
  }
  .trump-indicator {
    font-size: 10px;
    padding: 6px 7px;
  }
}

.table-playarea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  flex: 1;
  min-height: 0;
  padding-right: 24px;
  gap: 8px;
}
.table-playarea .arena {
  margin: 0 18px;
}
.arena[data-many="true"] {
  min-height: 560px;
}
.timeline {
  position: relative;
  min-width: 0;
  border-left: 1px solid #b4c79b18;
  margin: 16px 0 20px;
}
.timeline-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 0 0 20px;
}
.timeline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.timeline-heading h2 {
  font:
    16px "Songti SC",
    serif;
  font-weight: 400;
  color: #c0ccb0;
  letter-spacing: 2px;
}
.timeline-heading > span {
  font-size: 8px;
  color: #6e8965;
}
.table-log {
  list-style: none;
  margin: 0;
  padding: 0 8px 0 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #47623d transparent;
}
.log-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 0 15px 13px;
  border-left: 1px solid #b4c79b17;
  margin-left: 3px;
}
.log-row:before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #647f56;
  left: -3px;
  top: 3px;
}
.log-row time {
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 0.5px;
  color: #69885c;
}
.log-row > span {
  font-size: 10px;
  line-height: 1.8;
  color: #8ea47d;
  overflow-wrap: anywhere;
}
.log-row.log-reveal > span,
.log-row.log-finish > span {
  color: #d8c68e;
}
.log-row.log-reveal:before,
.log-row.log-finish:before {
  background: #d4b570;
}
.log-row.log-trick > span {
  color: #bdc9a2;
}
.log-empty {
  font-size: 10px;
  line-height: 1.8;
  color: #78916c;
  padding: 10px 0;
}
#log-latest {
  padding: 10px 0;
  color: var(--gold);
  border-top: 1px solid #c4d1a514;
}
#table-log-toggle {
  display: none;
}
.table-tools #table-account {
  width: 28px;
  height: 28px;
  border: 1px solid #c1c9a329;
  border-radius: 50%;
  font-size: 17px;
  padding: 0;
}
.table-tools #table-rules {
  width: auto;
  border: 0;
  border-radius: 0;
  font-size: 11px;
}
.table-tools #table-account:after {
  content: none;
}
.seat.you .seat-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.seat.you .seat-avatar:after {
  display: none;
}
.seat-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.seat[title] .seat-name {
  text-decoration: underline dotted #9fae7944;
  text-underline-offset: 3px;
}

.point-pile {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 158px;
  padding: 0 5px 13px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 0;
  background: none;
  color: #d4d8b7;
  z-index: 2;
  text-align: left;
}
.point-pile:active:not(:disabled) {
  transform: translate(-50%, -50%);
}
.point-pile:hover .pile-stack {
  filter: brightness(1.07);
}
.pile-stack {
  display: block;
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 57px;
}
.pile-stack .poker-card {
  --card-w: 38px;
  --card-h: 53px;
  position: absolute;
  top: calc(var(--stack-i) * -1px);
  left: calc(var(--stack-i) * 1px);
  transform: rotate(var(--stack-angle));
  box-shadow: 0 2px 3px #09221677;
}
.pile-stack .card-symbol {
  font-size: 20px;
}
.pile-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}
.pile-label > small {
  font-size: 8px;
  color: #93a67b;
}
.pile-label > strong {
  font:
    27px/1.15 Georgia,
    serif;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pile-escaped {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  text-align: center;
  font-size: 8px;
  color: #6f8c61;
  white-space: nowrap;
}
.empty-pile {
  display: grid;
  place-items: center;
  text-align: center;
  white-space: pre-line;
  font:
    15px/1.4 Georgia,
    serif;
  color: #899d6744;
  width: 38px;
  height: 53px;
  border: 1px dashed #acb98238;
  border-radius: 4px;
}
.point-cards {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 3px 0 10px;
}
.poker-card.point-card {
  border-bottom: 3px solid #b98c43;
}
.point-mark {
  position: absolute;
  bottom: 5px;
  left: 3px;
  min-width: 18px;
  padding: 2px 1px;
  background: #dbb56c77;
  border: 1px solid #b9904266;
  border-radius: 3px;
  color: #755322;
  font: 8px/1 sans-serif;
  text-align: center;
}
.mini .point-mark {
  bottom: 3px;
  left: 2px;
  min-width: 15px;
  font-size: 6px;
  padding: 2px 0;
}
.joker-icon {
  position: absolute;
  width: 43px;
  height: 52px;
  bottom: 12px;
  right: 4px;
  overflow: visible;
}
.joker-word {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  font: 6px/1 sans-serif;
  letter-spacing: 1.7px;
}
.mini .joker-icon {
  width: 28px;
  height: 34px;
  bottom: 8px;
  right: 2px;
}
.mini .joker-word {
  bottom: 3px;
  font-size: 4px;
  letter-spacing: 1px;
}

#settings-players,
#settings-decks {
  flex-wrap: wrap;
}
#settings-players button {
  flex: 1 0 11%;
}
#settings-decks button {
  flex: 1 0 28%;
}
#settings-target {
  max-width: 200px;
}
.account-form,
.account-form > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-form {
  gap: 15px;
}
.account-form > label {
  margin-bottom: -6px;
}
.account-avatar-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}
.account-avatar-area img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #9cac89;
}
.account-avatar-area p {
  flex-basis: 100%;
  font-size: 11px;
}
.account-avatar-area label {
  cursor: pointer;
  margin: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.account-avatar-area:focus-within label {
  outline: 2px solid #ab8550;
  outline-offset: 3px;
}
#account-feedback {
  overflow-wrap: anywhere;
  color: #8b6946;
}
#home-account {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .table-playarea {
    grid-template-columns: minmax(0, 1fr) 210px;
    padding-right: 18px;
  }
  .timeline-panel {
    padding-left: 14px;
  }
  .table-playarea .arena {
    margin: 0 12px;
  }
  .point-pile {
    width: 145px;
    gap: 11px;
  }
}
@media (max-width: 900px) {
  .table-playarea {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0;
  }
  .timeline {
    display: none;
    margin: 0 22px 15px;
    border-left: 0;
    border-top: 1px solid #b4c79b22;
    height: 210px;
  }
  .timeline-panel {
    padding: 15px 0 0;
  }
  .table-playarea.show-log .timeline {
    display: block;
  }
  #table-log-toggle {
    display: block;
  }
  .table-log {
    padding-right: 5px;
  }
  .log-row {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 7px;
    padding-bottom: 10px;
  }
  .log-row time {
    padding-top: 3px;
  }
  .timeline-heading {
    margin-bottom: 13px;
  }
  .arena[data-many="true"] {
    min-height: 590px;
  }
  .home-nav {
    gap: 20px;
  }
}
@media (max-width: 480px) {
  .table-tools {
    gap: 5px;
  }
  .table-tools #table-account,
  .table-tools #table-log-toggle {
    width: 23px;
    height: 23px;
    font-size: 14px;
    padding: 0;
  }
  .table-tools #table-rules {
    font-size: 0;
    width: 20px;
    padding: 0;
  }
  .table-tools #table-rules:after {
    content: "⚙";
    font-size: 15px;
  }
  .table-wordmark small {
    display: none;
  }
  .table-location {
    max-width: 90px;
  }
  .table-location #table-invite {
    display: none;
  }
  .home-nav {
    gap: 10px;
  }
  #home-account {
    max-width: 130px;
    font-size: 10px;
  }
  .point-pile {
    width: 128px;
    gap: 9px;
    padding-bottom: 9px;
  }
  .pile-stack {
    width: 35px;
    height: 43px;
  }
  .pile-stack .poker-card {
    --card-w: 29px;
    --card-h: 41px;
  }
  .pile-stack .card-symbol {
    font-size: 16px;
  }
  .pile-label > strong {
    font-size: 22px;
  }
  .pile-label > small,
  .pile-escaped {
    font-size: 7px;
  }
  .empty-pile {
    width: 30px;
    height: 41px;
    font-size: 12px;
  }
  .joker-icon {
    width: 37px;
    height: 45px;
  }
  .mini .joker-icon {
    width: 23px;
    height: 28px;
    bottom: 6px;
  }
  .play-cluster .mini .joker-word {
    font-size: 3px;
  }
  .play-cluster .point-mark {
    font-size: 5px;
    min-width: 12px;
  }
  .arena[data-many="true"] {
    min-height: 620px;
  }
  .arena[data-many="true"] .top-seat {
    gap: 3px 5px;
  }
  .arena[data-many="true"] .seat-name {
    max-width: 52px;
  }
  .hand-bottom {
    line-height: 1.6;
  }
}

.hand {
  gap: 8px;
}
/* Keep the original hit area after a card lifts, so a second click still lands. */
.hand .poker-card.selected:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 18px;
}
.hand-scroll.select-mode,
.hand-scroll.select-mode * {
  touch-action: none;
}
.hand-scroll.is-dragging,
.hand-scroll.is-dragging * {
  cursor: grabbing;
  user-select: none;
}
.hand-scroll.is-dragging .poker-card {
  transition: transform 0.055s ease;
}
.poker-card.off-suit {
  opacity: 0.5;
  filter: saturate(0.4);
  transform: none !important;
}
.poker-card.follow-card {
  box-shadow:
    inset 0 -2px #8aa57c,
    -2px 3px 5px #06130d44;
}
.poker-card.follow-card.selected {
  box-shadow:
    0 0 0 2px var(--gold),
    -2px 4px 7px #071a1055;
}
#hand-select-mode {
  display: none;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid #acc79122;
  border-radius: 4px;
  font-size: 9px;
}
#hand-select-mode[aria-pressed="true"] {
  color: var(--gold);
  border-color: #dfc78c77;
  background: #dfc78c0b;
}
.pile-stack .poker-card {
  animation: score-land 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.log-row {
  animation: log-arrive 0.18s ease-out;
}
@media (hover: hover) {
  .poker-card.selectable:not(:disabled):hover {
    transform: translateY(-8px) rotate(-1deg);
    filter: brightness(1.035);
  }
  .poker-card.selectable.selected:not(:disabled):hover {
    transform: translateY(-18px) rotate(-1deg);
  }
}
@media (hover: none) {
  .poker-card.selectable:not(.selected):hover {
    transform: none;
  }
  .poker-card.selectable.selected:hover {
    transform: translateY(-15px);
  }
}
@media (any-pointer: coarse) {
  #hand-select-mode {
    display: block;
  }
  .hand-caption {
    flex-wrap: wrap;
    gap: 6px;
  }
  #hand-summary {
    margin-left: auto;
  }
  .hand-scroll.is-dragging .poker-card {
    transition: none;
  }
}
@keyframes score-land {
  from {
    opacity: 0.4;
    transform: translateY(-9px) rotate(calc(var(--stack-angle) - 5deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--stack-angle));
  }
}
@keyframes log-arrive {
  from {
    opacity: 0.25;
    translate: 0 4px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
