/* Trick-taking card games (Hearts, Spades): js/games/tricks-table.js. The table and cards are
 * Solitaire's (css/games/solitaire.css, loaded with this file). */

.tk-room .sc-card { transform-origin: 0 0; }
.tk-room.sc-anim .sc-card, .tk-room .sc-anim .sc-card { transition: transform .32s cubic-bezier(.2, .8, .3, 1), opacity .32s ease; }
.tk-room .sc-card.tk-gone { opacity: 0; pointer-events: none; }
.tk-room .sc-card:not(.tk-mine) { cursor: default; }
.tk-room .sc-card.is-down { box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
/* cards you can't play now are dimmer; tapping one still explains why */
.tk-room .sc-card.tk-dim { filter: brightness(.62) saturate(.8); }
:root[data-theme="light"] .tk-room .sc-card.tk-dim { filter: brightness(.82) saturate(.7); }
.tk-room .sc-card.tk-sel { box-shadow: 0 0 0 3px var(--ink), 0 10px 22px rgba(0, 0, 0, .35); }
.tk-room .sc-card.tk-mine:focus { outline: none; }
/* keyboard focus on a card in your hand: the site's ring, and the card comes to the front */
.tk-room .sc-card.tk-mine:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; border-radius: 8px; z-index: 350 !important; }
.tk-room .sc-card.tk-fresh { box-shadow: 0 0 0 3px var(--positive), 0 8px 18px rgba(0, 0, 0, .3); }

/* the score line, the seats, the status line */
.tk-top, .tk-status, .tk-seat { position: absolute; margin: 0; z-index: 400; pointer-events: none; color: var(--ink); }
.tk-top { text-align: center; font-size: .85rem; line-height: 1.35; color: var(--ink-muted); }
.tk-top b { color: var(--ink); font-weight: 600; }
.tk-status { font-size: .95rem; line-height: 1.3; text-align: center; padding-top: .35rem; }
.tk-seat { display: flex; flex-direction: column; gap: 1px; padding: .2rem .5rem; border-radius: var(--radius-md); box-sizing: border-box; font-size: .85rem; line-height: 1.3; }
.tk-seat-0 { align-items: flex-start; }
.tk-seat-1, .tk-seat-2, .tk-seat-3 { align-items: center; }
.tk-name { font-weight: 600; font-size: .95rem; }
.tk-info { color: var(--ink-muted); white-space: nowrap; }
.tk-seat.is-turn { background: var(--fill-strong); box-shadow: inset 0 0 0 2px var(--ink); }
.tk-seat-0.is-turn { box-shadow: none; background: none; }

/* the centre panel: passing, bidding, the end of a hand, the last trick */
.tk-panel {
  position: absolute; z-index: 500; transform: translate(-50%, -50%); width: max-content; box-sizing: border-box; overflow: auto;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center;
  padding: var(--space-4) var(--space-5); background: var(--surface-200); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
}
.tk-panel[hidden] { display: none; }
.tk-panel p { margin: 0; line-height: 1.4; }
.tk-panel h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.tk-panel .btn { min-height: var(--control-lg, 52px); }
.tk-panel-quiet { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.tk-sub { font-size: .85rem; color: var(--ink-muted); }

/* bidding: Nil and 1-13 as big buttons */
.tk-bids { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 6px; width: 100%; }
.tk-bids .kit-chip { min-width: 0; padding: 0 .2rem; font-size: 1rem; min-height: var(--tap-min, 48px); }

/* scores at the end of a hand */
.tk-scores { border-collapse: collapse; font-size: .95rem; width: 100%; }
.tk-scores th, .tk-scores td { padding: .3rem .55rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tk-scores th:first-child, .tk-scores td:first-child { text-align: left; }
.tk-scores thead th { font-size: .85rem; font-weight: 500; color: var(--ink-muted); }
.tk-scores tr.is-you td { font-weight: 600; }
.tk-scores tr:last-child td { border-bottom: 0; }

/* the last trick: four small cards in a cross */
.tk-mini-trick { position: relative; width: 13rem; height: 11.5rem; }
.tk-mini { position: absolute; width: 4.1rem; height: 5.74rem; border-radius: .35rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.tk-mini.is-win { box-shadow: 0 0 0 3px var(--positive), 0 1px 3px rgba(0, 0, 0, .35); }
.tk-mini-s { left: 4.45rem; bottom: 0; }
.tk-mini-n { left: 4.45rem; top: 0; }
.tk-mini-w { left: 0; top: 2.88rem; }
.tk-mini-e { right: 0; top: 2.88rem; }

@media (prefers-reduced-motion: reduce) {
  .tk-room.sc-anim .sc-card, .tk-room .sc-anim .sc-card { transition: none; }
}
