/* Winning Hand */
.wh-table { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-radius: var(--radius); background: #0002; min-height: 330px; }
[data-suits=three] .wh-table { min-height: 377px; }
.game:not(.is-ready) .wh-table * { visibility: hidden; }
.wh-head { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }
.wh-head p { margin: 0; }
.wh-head b { display: inline-block; min-width: 2em; padding: 0 .4em; border-radius: 99px; background: #0005; text-align: center; }
.wh-away b { background: var(--gold); color: #2b2205; }
.wh-pile { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0; padding: 0; list-style: none; max-width: 720px; }
.wh-pile li { width: var(--s); aspect-ratio: 3 / 4; border-radius: 4px; }
.wh-pile li:empty { border: 1px dashed #fff4; }
.wh-pile img, .wh-group img { display: block; width: 100%; height: 100%; padding: 2px; border-radius: 4px; background: linear-gradient(150deg, var(--ivory), var(--ivory-2)); box-shadow: 1px 2px 0 0 var(--tile-side); }
.wh-hand { display: grid; padding-top: 14px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.wh-tile {
  position: relative; display: flex; flex-direction: column; width: var(--w); height: calc(var(--w) * 4 / 3 + 14px); padding: 3px 3px 0; border: 0; border-radius: 7px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(150deg, var(--ivory), #fbf5e3 55%, var(--ivory-2)); color: var(--ink); font: 700 12px/14px system-ui, sans-serif;
  box-shadow: inset 0 0 0 1px #7d623359, 1px 2px 0 0 var(--tile-side), 2px 4px 0 0 var(--tile-side), 2px 5px 3px 0 #0007;
  transition: transform .12s;
}
.wh-tile img { flex: 1; min-height: 0; object-fit: contain; pointer-events: none; }
.wh-tile.is-drawn { margin-left: var(--apart); }
.wh-tile.is-selected { transform: translateY(-10px); z-index: 2; background: linear-gradient(150deg, #fff8d6, var(--gold-soft)); box-shadow: inset 0 0 0 3px var(--gold), 2px 4px 0 0 #c99a2b; }
.wh-tile.is-hint { box-shadow: inset 0 0 0 3px var(--focus), 2px 4px 0 0 var(--tile-side); }
.wh-tile[data-flag]::before { content: attr(data-flag); position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 6px; border-radius: 99px; background: var(--jade-900); color: var(--gold-soft); font-size: 10px; line-height: 15px; }
.is-dealt .is-drawn, .is-dealt .is-last { animation: wh-draw .2s; }
@keyframes wh-draw { from { transform: translateY(-16px); opacity: 0; } }
.wh-mark { height: 25px; margin: 6px 3px 0; border-top: 3px solid; color: var(--gold-soft); font-size: 11px; line-height: 13px; text-align: center; white-space: nowrap; }
.is-pair { border-top-style: dashed; }
.wh-go { min-height: 44px; min-width: min(300px, 100%); }
.wh-go:disabled { opacity: 1; background: #0003; border: 1px dashed; color: #d4ecdf; }
.wh-help { max-width: 720px; margin: 4px auto 0; text-align: center; }
.wh-help summary { cursor: pointer; padding: 6px; }
.wh-groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin: 0 0 12px; }
.wh-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: 116px; }
.wh-group img { width: 30px; height: 40px; }
.wh-group span { flex: 1 0 100%; font-size: .78rem; line-height: 1.3; margin-top: 4px; }
.wh-points { list-style: none; margin: 0 auto 12px; padding: 0; max-width: 260px; }
.wh-points li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wh-points li:last-child { border: 0; font-weight: 700; }
@media (max-width: 760px) {
  .game-actions.wh-actions { grid-template-columns: repeat(4, 1fr); }
  .wh-table { margin-inline: -8px; padding: 8px 2px; gap: 8px; min-height: min(54vw + 210px, 100vh); }
  [data-suits=three] .wh-table { min-height: min(61vw + 220px, 100vh); }
  .wh-table + .game-status { min-height: 3.2em; }
  .wh-head { gap: 2px 14px; font-size: min(.92rem, 4.1vw); }
}
@media (min-width: 761px) and (max-width: 1024px) and (orientation: portrait) {
  .wh-table { min-height: 493px; }
  [data-suits=three] .wh-table { min-height: 542px; }
}
@media (prefers-reduced-motion: reduce) {
  .wh-tile, .is-dealt * { transition: none; animation: none !important; }
}
