/* gcp:css/table.css v0.635 */
/* Physical left | board | right — grid is always LTR so RTL text cannot swap columns */
.table-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.stage-board {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.stage-tracker, .stage-log, .stage-book { display: none; }

@media (min-width: 860px) {
  .table-stage {
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) minmax(188px, 240px);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "tracker board log";
    gap: 10px;
    padding: 8px 10px 10px;
    min-height: 0;
    flex: 1;
    align-items: stretch;
    justify-items: stretch;
  }
  .page-bkout .table-stage {
    grid-template-columns: minmax(252px, 310px) minmax(0, 1fr) minmax(188px, 240px);
  }
  .table-stage:is(.view-trix, .view-hand) {
    grid-template-columns: minmax(0, 1fr) minmax(188px, 240px);
    grid-template-areas: "board log";
  }
  .table-stage:is(.view-trix, .view-hand) .stage-tracker { display: none; }
  .table-stage:is(.view-trix, .view-hand) .stage-board { grid-area: board; grid-column: 1; grid-row: 1; }
  .table-stage:is(.view-trix, .view-hand) .stage-log { grid-area: log; grid-column: 2; grid-row: 1; }
  .stage-tracker {
    display: flex; grid-area: tracker; grid-column: 1; grid-row: 1;
    min-height: 0; min-width: 0; height: 100%;
    overflow: hidden;
  }
  .stage-board {
    grid-area: board; grid-column: 2; grid-row: 1;
    min-height: 0; min-width: 0; height: 100%;
  }
  .page-bkout .table-stage .stage-board {
    min-width: 320px;
  }
  .stage-log {
    display: flex; grid-area: log; grid-column: 3; grid-row: 1;
    min-height: 0; min-width: 0; height: 100%;
  }
  html[dir="rtl"] .stage-tracker,
  html[dir="rtl"] .stage-board,
  html[dir="rtl"] .stage-log { direction: rtl; }
  .card-tracker.grid-kout .mini-card.small,
  .card-tracker.grid-kout .mini-card.honor {
    height: 56px;
    font-size: 16px;
  }
  .card-tracker.grid-kout .mini-card.honor { height: 60px; font-size: 17px; }
  .card-tracker.grid-kout .card-tracker-cards { gap: 5px; }
  .hook-hands .mini-card.small { height: 54px; font-size: 16px; }
  .hook-hands .card-tracker-cards { gap: 5px; }
  .hook-hand { padding: 8px 6px 10px; }
  .hook-hand-name { font-size: 13px; }
  .card-tracker.grid-kout .mini-card .ms,
  .hook-hands .mini-card .ms { font-size: 15px; }
}
@media (min-width: 1400px) {
  .table-stage.wide-book {
    grid-template-columns: minmax(0, 220px) minmax(360px, 1fr) minmax(0, 200px) minmax(0, 240px);
    grid-template-areas: "tracker board log book";
  }
  .table-stage.wide-book .stage-book {
    display: flex; grid-area: book; grid-column: 4; grid-row: 1;
    min-height: 0; min-width: 0; max-width: 240px; height: 100%;
    overflow: auto;
  }
  .page-bkout .table-stage {
    grid-template-columns: minmax(0, 300px) minmax(360px, 1fr) minmax(0, 220px);
  }
  .page-bkout .table-stage.wide-book {
    grid-template-columns: minmax(0, 280px) minmax(380px, 1fr) minmax(0, 200px) minmax(0, 240px);
    grid-template-areas: "tracker board log book";
  }
  .page-bkout .table-stage.wide-book .stage-book {
    display: flex; grid-area: book; grid-column: 4; grid-row: 1;
    min-height: 0; min-width: 0; max-width: 240px; height: 100%;
    overflow: auto;
  }
  html[dir="rtl"] .stage-book { direction: rtl; }
  .card-tracker.grid-kout .mini-card.small,
  .card-tracker.grid-kout .mini-card.honor,
  .hook-hands .mini-card.small {
    height: 64px;
    font-size: 18px;
  }
  .card-tracker.grid-kout .mini-card.honor { height: 68px; font-size: 19px; }
}
.stage-book .bk-score {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
}
.stage-book .bk-score { padding: 8px; }
.stage-book .bk-score-meta { font-size: 11px; }
.stage-book .bk-book-wrap { overflow-x: hidden; }
.stage-book .sg-book { width: 100%; cursor: pointer; }
.stage-book .score-hist-table.slim { font-size: 12px; table-layout: fixed; }
.stage-book .score-hist-table.slim th,
.stage-book .score-hist-table.slim td { padding: 5px 3px; }
.stage-book .score-hist-table.slim .score-delta { display: block; font-size: 10px; }

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 10px 8px;
  flex-shrink: 0;
}
.status-bar.n2 { grid-template-columns: 1fr 1fr; }
.player-status {
  --seat: var(--accent);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-mid) 70%, #000) 0%, var(--bg-deep) 100%);
  border: 1px solid color-mix(in srgb, var(--seat) 28%, var(--border));
  border-radius: 10px;
  padding: 8px 10px 9px;
  min-width: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 6%, transparent);
}
.player-status::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--seat);
  opacity: 0.4;
}
.player-status.p0 { --seat: #38bdf8; }
.player-status.p1 { --seat: #34d399; }
.player-status.p2 { --seat: #fb923c; }
.player-status.p3 { --seat: #a78bfa; }
.player-status.p4 { --seat: #f472b6; }
.player-status.p5 { --seat: #facc15; }
.player-status.team-us { --seat: var(--team-us); }
.player-status.team-them { --seat: var(--team-them); }
.player-status.us { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--seat) 25%, transparent); }
.player-status.active {
  border-color: var(--seat);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--seat) 42%, transparent),
    inset 0 0 22px color-mix(in srgb, var(--seat) 10%, transparent);
}
.player-status.active::before { opacity: 1; height: 3px; }
.player-status.king {
  border-color: var(--warn);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--warn) 48%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--warn) 12%, transparent);
}
.player-status.king::before {
  background: var(--warn);
  opacity: 1;
  height: 3px;
}
.player-status.king.active {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--warn) 55%, transparent),
    0 0 0 5px color-mix(in srgb, var(--seat) 28%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--warn) 12%, transparent);
}
.player-status.king-done {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
}

.ps-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}
.ps-name {
  font-weight: 800;
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--seat);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ps-star { color: var(--warn); flex-shrink: 0; font-size: 16px; }
.ps-hearts {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fecaca;
  background: color-mix(in srgb, #9f1239 82%, transparent);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.35;
}
.ps-pens {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  line-height: 1;
}
.ps-pen {
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.15;
  padding: 1px 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg-deep) 55%, var(--fg) 8%);
}
.ps-pen.qs { color: var(--fg); }
.ps-pen.td { color: #f87171; }
.ps-opened {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
}
.ps-king {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #1c1917;
  background: var(--warn);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}
.ps-king-done {
  flex-shrink: 0;
  color: var(--success);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.ps-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ps-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.ps-lab {
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  flex-shrink: 0;
}
.ps-num {
  font-size: clamp(22px, 3.8vw, 34px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
  border-radius: 5px;
  padding: 4px 10px 5px;
  min-width: 1.55em;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.04em;
}
.ps-metric.score .ps-num {
  font-size: clamp(28px, 5vw, 44px);
  color: #fde68a;
  min-width: 1.7em;
}
.ps-metric.tally .ps-num {
  font-size: clamp(22px, 3.6vw, 32px);
  min-width: 2.4em;
}
.ps-slash {
  margin: 0 0.12em;
  color: var(--muted);
  font-weight: 700;
}
.ps-num.hot, .ps-num .hot { color: var(--success); }
.ps-num.over, .ps-num .over { color: var(--danger); }
.ps-board.solo .ps-num {
  font-size: clamp(28px, 5vw, 42px);
  min-width: 2em;
}
.ps-board.solo { gap: 2px; }
.ps-delta {
  align-self: flex-end;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  min-height: 1.1em;
}
.ps-delta.up { color: var(--success); }
.ps-delta.down { color: var(--danger); }
.ps-delta.zero { color: var(--muted); opacity: 0.72; }

.team-status { overflow: visible; padding: 8px 12px 10px; }
.team-status .ts-board {
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
}
.team-status .ts-board .ps-metric {
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  min-height: 0;
}
.team-status .ts-board .ps-lab { font-size: 12px; }
.ts-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ts-player {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(13px, 1.7vw, 16px);
  color: color-mix(in srgb, var(--seat) 62%, var(--muted));
  background: color-mix(in srgb, var(--seat) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--seat) 22%, transparent);
  max-width: 100%;
  white-space: nowrap;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.ts-player.on {
  color: var(--seat);
  background: color-mix(in srgb, var(--seat) 24%, transparent);
  border-color: var(--seat);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seat) 38%, transparent);
}
.ts-player .ps-star { font-size: 12px; }

html[data-theme="white"] .ps-num {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
html[data-theme="white"] .ps-metric.score .ps-num { color: #92400e; }
html[data-theme="white"] .ps-slash { color: #64748b; }
html[data-theme="white"] .ps-king { color: #1c1917; }
html[data-theme="white"] .ps-delta.zero { color: #64748b; }

@media (max-width: 639px) {
  .status-bar { gap: 5px; padding: 4px 6px 6px; }
  .player-status { padding: 6px 6px 7px; border-radius: 8px; }
  .ps-head { margin-bottom: 4px; }
  .ps-name { font-size: 15px; }
  .ps-star { font-size: 14px; }
  .ps-king { font-size: 9px; padding: 1px 6px; }
  .ps-king-done { font-size: 13px; }
  .ps-delta { font-size: 12px; }
  .ps-lab { font-size: 12px; letter-spacing: 0.02em; }
  .ps-metric { min-height: 26px; gap: 4px; }
  .ps-num { font-size: 18px; padding: 2px 6px 3px; }
  .ps-metric.score .ps-num { font-size: 24px; }
  .ps-metric.tally .ps-num { font-size: 18px; }
  .ts-player { font-size: 12px; padding: 3px 8px; }
  .ts-names { gap: 4px; margin-top: 6px; }
  .team-status { padding: 6px 8px 8px; }
}

.info-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 10px;
  flex-shrink: 0;
  z-index: 4;
}
@media (min-width: 640px) {
  .info-bar { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
}

.table-msg {
  max-width: min(96%, 560px);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--fg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 9px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.table-msg:empty { display: none; }

.felt {
  position: relative;
  margin: 0 8px 8px;
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  background-color: var(--felt-cloth, #1a6b3c);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.18  0 0 0 0 0.1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--felt-cloth, #1a6b3c) 78%, #fff) 0%, transparent 46%),
    radial-gradient(ellipse at 50% 55%, transparent 42%, rgba(0,0,0,.38) 100%);
  background-blend-mode: overlay, overlay, overlay, soft-light, multiply;
  background-size: 160px 160px, auto, auto, auto, auto;
  border: 11px solid var(--felt-rail, #2a1810);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--felt-rail, #2a1810) 55%, #b08948),
    inset 0 0 36px 8px rgba(0,0,0,.38),
    0 10px 24px rgba(0,0,0,.28);
}
.felt::before,
.felt::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  pointer-events: none;
  z-index: 1;
  background-color: color-mix(in srgb, var(--accent) 55%, #fff);
  -webkit-mask: var(--gulf-wave) repeat-x center / 160px 16px;
  mask: var(--gulf-wave) repeat-x center / 160px 16px;
}
.felt::before {
  bottom: 14px;
  height: 14px;
  opacity: 0.18;
}
.felt::after {
  bottom: 6px;
  height: 10px;
  opacity: 0.1;
  -webkit-mask-size: 200px 14px;
  mask-size: 200px 14px;
}
.seat { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.seat-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.seat-n { top: 8px; left: 50%; transform: translateX(-50%); }
.seat-w { top: 42%; left: 8px; right: auto; transform: translateY(-50%); }
.seat-e { top: 42%; right: 8px; left: auto; transform: translateY(-50%); }
.seat-sw { bottom: 16%; left: 6px; right: auto; }
.seat-se { bottom: 16%; right: 6px; left: auto; }
.seat-nw { top: 12%; left: 6px; right: auto; }
.seat-ne { top: 12%; right: 6px; left: auto; }
.seats-3 .seat { display: none; }
.seats-6 .seat-chip { display: none; }
.page-bkout .table-stage .seat { display: none; }
.felt.seats-6 { min-height: 280px; }
.seat-chip {
  display: flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  padding: 4px 8px 4px 4px; font-size: 11px; font-weight: 700;
}
.seat-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--team-them); }
.seat.us .dot { background: var(--team-us); }
.seat.team-seat.them .dot {
  width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg);
  background: var(--team-them);
}
.seat.active .seat-chip { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.seat-backs, .seat-backs .n { display: none !important; }

.trick-area {
  direction: ltr;
  display: grid;
  place-items: center;
  gap: 6px 10px;
  width: min(460px, 92%);
  z-index: 3;
  padding: 8px;
}
.trick-area.seats-4 {
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
}
.trick-area.seats-4 .trick-p0 { grid-column: 2; grid-row: 3; }
.trick-area.seats-4 .trick-p1 { grid-column: 1; grid-row: 2; justify-self: end; }
.trick-area.seats-4 .trick-p2 { grid-column: 2; grid-row: 1; }
.trick-area.seats-4 .trick-p3 { grid-column: 3; grid-row: 2; justify-self: start; }

.trick-area.seats-3 {
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  width: min(420px, 92%);
  padding-bottom: 22px;
  align-items: end;
}
.trick-area.seats-3 .trick-p0 { grid-column: 2; grid-row: 2; z-index: 4; transform: translateY(-6px); }
.view-sergeant .felt { padding-bottom: 20px; }
.trick-area.seats-3 .trick-p1 { grid-column: 3; grid-row: 1; justify-self: start; }
.trick-area.seats-3 .trick-p2 { grid-column: 1; grid-row: 1; justify-self: end; }

.trick-area.seats-6 {
  display: block;
  position: relative;
  width: min(calc(var(--card-w) * 8), 94%);
  height: min(calc(var(--card-h) * 4.6), 64vh);
  min-height: calc(var(--card-h) * 3.4);
}
.trick-area.seats-6 .trick-p {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  margin: 0;
}
.trick-area.seats-6 .trick-p0 { transform: translate(-50%, -50%) translateY(calc(var(--card-h) * 1.55)) rotate(0deg); }
.trick-area.seats-6 .trick-p1 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * 2.2), calc(var(--card-h) * 0.88)) rotate(18deg); }
.trick-area.seats-6 .trick-p2 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * 2.2), calc(var(--card-h) * -0.88)) rotate(10deg); }
.trick-area.seats-6 .trick-p3 { transform: translate(-50%, -50%) translateY(calc(var(--card-h) * -1.55)) rotate(0deg); }
.trick-area.seats-6 .trick-p4 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * -2.2), calc(var(--card-h) * -0.88)) rotate(-10deg); }
.trick-area.seats-6 .trick-p5 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * -2.2), calc(var(--card-h) * 0.88)) rotate(-18deg); }
@media (max-width: 639px) {
  .trick-area.seats-6 { height: 250px; min-height: 230px; }
  .trick-area.seats-6 .trick-p0 { transform: translate(-50%, -50%) translateY(88px); }
  .trick-area.seats-6 .trick-p1 { transform: translate(-50%, -50%) translate(86px, 48px) rotate(32deg); }
  .trick-area.seats-6 .trick-p2 { transform: translate(-50%, -50%) translate(86px, -48px) rotate(16deg); }
  .trick-area.seats-6 .trick-p3 { transform: translate(-50%, -50%) translateY(-90px); }
  .trick-area.seats-6 .trick-p4 { transform: translate(-50%, -50%) translate(-86px, -48px) rotate(-16deg); }
  .trick-area.seats-6 .trick-p5 { transform: translate(-50%, -50%) translate(-86px, 48px) rotate(-32deg); }
}

.trick-p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trick-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-mid) 80%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(200px, 46vw);
  white-space: nowrap;
  overflow: visible;
}
.trick-who {
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trick-p.team-us .trick-name { color: var(--team-us); }
.trick-p.team-them .trick-name { color: var(--team-them); }
.team-pip {
  width: 8px; height: 8px; flex-shrink: 0;
  background: var(--team-us); border-radius: 50%;
}
.team-pip.them {
  width: 7px; height: 7px; border-radius: 2px;
  transform: rotate(45deg); background: var(--team-them);
}
.team-lab { font-weight: 800; font-size: 10px; }
.trick-area.seats-6 .team-lab { display: none; }
.trick-p.team-us .trick-slot {
  border-color: color-mix(in srgb, var(--team-us) 55%, transparent);
}
.trick-p.team-them .trick-slot {
  border-color: color-mix(in srgb, var(--team-them) 55%, transparent);
}
.trick-slot {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 8px;
  border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  padding: 4px;
}
.trick-p.active .trick-slot,
.trick-p.your-turn .trick-slot {
  border-style: solid;
  border-color: var(--accent);
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: yourTurnPulse 1.4s ease-in-out infinite;
}
.trick-p.your-turn .trick-slot { animation: yourTurnPulse 1.4s ease-in-out infinite !important; }
@keyframes yourTurnPulse {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 55%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .trick-p.active .trick-slot { animation: none; }
}

.stage-board .end-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.52);
  padding: 10px;
  pointer-events: auto;
}
.stage-board .end-card {
  position: relative;
  z-index: 41;
  max-height: min(92%, 86vh);
}
.kout-celeb-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.kout-celeb-mask .victory-card { position: relative; max-width: min(360px, 100%); }
.end-card { width: min(320px, 90%); border-radius: 16px; border: 1px solid var(--border); background: var(--surface); padding: 16px; text-align: center; max-height: 100%; overflow: auto; }

.kitty-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 6;
  padding: 8px;
}
.kitty-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.kitty-lab {
  font-size: 11px; font-weight: 800; color: var(--muted);
  background: color-mix(in srgb, var(--bg-mid) 82%, transparent);
  border-radius: 999px; padding: 2px 10px;
}

.hand-dock {
  background: linear-gradient(to top, var(--bg-deep) 60%, color-mix(in srgb, var(--bg-mid) 55%, transparent));
  padding: 4px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 44vh;
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 -10px 28px rgba(0,0,0,.18);
}
.hand-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  align-content: flex-end;
  gap: 6px 12px;
  padding-block: 18px 8px;
  max-height: 36vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  width: 100%;
  min-height: 0;
}
.hand-suit {
  display: contents;
}
.kitty-show-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
  direction: ltr;
}
.hand-row .pcard { flex-shrink: 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 8px; padding: 10px 8px 0; flex-shrink: 0; overflow: visible; }

button.pcard, .pcard {
  position: relative; flex-shrink: 0; overflow: hidden;
  width: var(--card-w); height: var(--card-h); border-radius: 7px;
  background: var(--card-face); border: 1px solid var(--card-edge);
  box-shadow: 0 2px 8px rgba(0,0,0,.28); padding: 0;
  isolation: isolate;
}
button.pcard.mini { width: var(--card-mini-w); height: var(--card-mini-h); border-radius: 5px; }
button.pcard.trick-size,
.trick-p button.pcard {
  width: var(--card-w); height: var(--card-h);
}
button.pcard.pcard-joker { background: var(--card-face); border-color: var(--card-edge); }
.pcard-stock { position: absolute; inset: 0; z-index: 0; border-radius: inherit; background: var(--card-face); pointer-events: none; }
button.pcard.pcard-joker .pcard-stock { background: var(--card-face); }
.pcard img, .pcard svg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; z-index: 1;
}
.pcard-playable { outline: 2px solid var(--accent); outline-offset: 1px; }
.pcard-playable:hover, .pcard-playable:active { transform: translateY(-8px); }
.pcard.dim { opacity: .4; filter: grayscale(.2); }
.pcard.burnt { opacity: .55; filter: grayscale(1) brightness(0.85); box-shadow: none; }
.pcard.selected { outline: 3px solid var(--warn); outline-offset: 2px; transform: translateY(-10px); }
.pcard.trump-card { background: #fef9c3; border-color: #eab308; box-shadow: 0 3px 10px rgba(250, 204, 21, 0.35); }
.pcard.trump-card .pcard-stock { background: #fef9c3; }
.pcard.trump-card img { mix-blend-mode: multiply; }
.pcard.from-kitty { background: #e0f2fe; border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35), 0 3px 10px rgba(56, 189, 248, 0.2); }
.pcard.from-kitty .pcard-stock { background: #e0f2fe; }
.pcard.from-kitty img { mix-blend-mode: multiply; }
.pcard.from-ex { background: #ede9fe; border-color: #8b5cf6; box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35), 0 3px 10px rgba(139, 92, 246, 0.18); }
.pcard.from-ex .pcard-stock { background: #ede9fe; }
.pcard.from-ex img { mix-blend-mode: multiply; }
.pcard.from-discard { background: #dcfce7; border-color: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35); }
.pcard.from-discard .pcard-stock { background: #dcfce7; }
.pcard.from-discard img { mix-blend-mode: multiply; }
.pcard.mark-king { background: #ffe4e6; border-color: #fb7185; box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.4); }
.pcard.mark-king .pcard-stock { background: #ffe4e6; }
.pcard.mark-king img { mix-blend-mode: multiply; }
.pcard.mark-diamond { background: #ffedd5; border-color: #fb923c; box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.35); }
.pcard.mark-diamond .pcard-stock { background: #ffedd5; }
.pcard.mark-diamond img { mix-blend-mode: multiply; }
.pcard.mark-queen { background: #fce7f3; border-color: #f472b6; box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.35); }
.pcard.mark-queen .pcard-stock { background: #fce7f3; }
.pcard.mark-queen img { mix-blend-mode: multiply; }
.pcard.mark-jack { background: #e0f2fe; border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35); }
.pcard.mark-jack .pcard-stock { background: #e0f2fe; }
.pcard.mark-jack img { mix-blend-mode: multiply; }
.pcard .card-origin {
  position: absolute; left: 2px; right: 2px; bottom: 1px; z-index: 8;
  font-size: 7px; font-weight: 700; text-align: center; color: #1e1b4b;
  background: rgba(167, 139, 250, 0.9); border-radius: 3px; padding: 0 2px;
  line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none; max-height: 12px;
}
.pcard .card-origin.returned {
  color: #f8fafc;
  background: rgba(99, 102, 241, 0.92);
  border: 1px solid rgba(165, 180, 252, 0.55);
}
.pcard.pcard-team-us {
  box-shadow: 0 0 0 2px var(--team-us), 0 2px 8px rgba(0,0,0,.28);
}
.pcard.pcard-team-them {
  box-shadow: 0 0 0 2px var(--team-them), 0 2px 8px rgba(0,0,0,.28);
}
.pcard .team-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 9;
  width: 11px;
  height: 11px;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px var(--card-face);
}
.pcard .team-mark.us {
  background: var(--team-us);
  border-radius: 50%;
}
.pcard .team-mark.them {
  width: 9px;
  height: 9px;
  top: 5px;
  right: 5px;
  background: var(--team-them);
  border-radius: 2px;
  transform: rotate(45deg);
}
.seat-pip {
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  overflow: visible;
}
.seat-pip.sm-0 { fill: #38bdf8; }
.seat-pip.sm-1 { fill: #34d399; }
.seat-pip.sm-2 { fill: #fb923c; }
.seat-pip.sm-3 { fill: #a78bfa; }
.player-status .seat-pip {
  width: 12px;
  height: 12px;
  fill: var(--seat);
  filter: drop-shadow(0 0 0.5px #0b1220);
}
.pcard .seat-pip-wrap {
  position: absolute;
  left: 2px;
  right: auto;
  bottom: 2px;
  top: auto;
  z-index: 10;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.pcard .seat-pip-wrap .seat-pip,
.pcard svg.seat-pip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 0.7px #fff) drop-shadow(0 0 1.1px #0b1220);
}
.pcard-back {
  background: #eaf0ff url("../cards/back.svg") center / 100% 100% no-repeat;
  border: 1px solid #1e3a8a;
  display: grid;
  place-items: center;
  color: transparent;
}
.pcard-back .pcard-stock { display: none; }
.back-mark { display: none; }
@media (prefers-reduced-motion: reduce) {
  .pcard-playable:hover, .pcard-playable:active, .pcard.selected, .pcard.just-drawn { transform: none; }
  .table-stage.view-hand .hand-flat .pcard { transition: none; }
}

.card-tracker {
  display: flex; width: 100%; flex-direction: column; gap: 6px; overflow-y: auto;
  background: var(--surface); border-radius: 14px; padding: 10px 8px;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); min-height: 0; min-width: 0;
}
.card-tracker-title { font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; letter-spacing: .06em; text-transform: uppercase; }
.card-tracker-suit { display: flex; flex-direction: column; gap: 3px; padding: 5px 4px; border-radius: 8px; }
.card-tracker-suit.trump { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.card-tracker-cards { display: flex; flex-wrap: nowrap; gap: 3px; width: 100%; }
.mini-card {
  border-radius: 6px; background: #fffef8; color: #0f172a; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.2);
  flex: 1 1 0; min-width: 0;
}
.mini-card.small { height: 44px; font-size: 12px; max-width: calc((100% - 12px) / 5); }
.mini-card.honor { height: 58px; font-size: 15px; max-width: calc((100% - 8px) / 3); }
.mini-card.red { color: #dc2626; }
.mini-card.in-hand { background: #fef08a; border-color: #eab308; }
.mini-card.gone { background: #0f172a; color: transparent; border: 1px solid #334155; }
.mini-card.discarded {
  background: linear-gradient(145deg, #7c2d12 0%, #431407 100%);
  color: rgba(254, 215, 170, 0.7);
  border: 1px solid #c2410c;
}
.mini-card.discarded.red .ms { color: rgba(252, 165, 165, 0.55); }

.card-tracker.grid-kout .card-tracker-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}
.card-tracker.grid-kout .mini-card.small,
.card-tracker.grid-kout .mini-card.honor {
  max-width: none;
  height: 40px;
  font-size: 12px;
}
.card-tracker.grid-kout .mini-card.honor { height: 44px; font-size: 13px; }
.card-tracker.grid-kout .mini-card.missing {
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--fg) 12%, transparent);
  box-shadow: none;
}
.hook-hand {
  padding: 6px 4px 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}
.hook-hand.team-us { border-color: color-mix(in srgb, var(--team-us) 40%, transparent); }
.hook-hand.team-them { border-color: color-mix(in srgb, var(--team-them) 40%, transparent); }
.hook-hand.you { background: color-mix(in srgb, var(--team-us) 10%, transparent); }
.hook-hand-name {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.hook-hand.team-us .hook-hand-name { color: var(--team-us); }
.hook-hand.team-them .hook-hand-name { color: var(--team-them); }
.hook-hands .card-tracker-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}
.hook-hands .mini-card.small { max-width: none; height: 36px; font-size: 11px; }

.trix-ladders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(640px, 96%);
  z-index: 3;
  padding: 8px;
  pointer-events: none;
}
.trix-col {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
}
.trix-col .lab { font-weight: 800; font-size: 18px; line-height: 1; }
.trix-col .lab.red { color: var(--danger); }
.trix-col .range { font-size: 11px; color: var(--muted); font-weight: 700; }
.trix-col.empty { opacity: 0.55; }
.trix-ladders .tx-lad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}
.trix-ladders .tx-lad .pcard,
.trix-ladders .tx-lad .pcard.trick-size {
  width: var(--card-w);
  height: var(--card-h);
  flex-shrink: 0;
}
.tx-lad-span {
  width: 2px;
  height: 10px;
  margin: 2px 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--fg) 32%, transparent);
  flex-shrink: 0;
}
.tx-jack-hint {
  width: var(--card-w);
  height: var(--card-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  color: var(--muted);
  border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: 8px;
}
@media (max-width: 639px) {
  .trix-ladders { width: min(100%, 96%); gap: 6px; padding: 4px; }
  .trix-col { padding: 6px 4px 8px; gap: 4px; }
  .trix-col .lab { font-size: 16px; }
  .tx-lad-span { height: 8px; margin: 1px 0; }
}

.hand-felt {
  width: 100%;
  height: 100%;
  margin: 0;
  z-index: 3;
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
}
.felt.hand-cloth {
  --felt-card-w: calc(var(--card-w) * 1.12);
  --felt-card-h: calc(var(--card-h) * 1.12);
  --felt-overlap: 0.48;
  --felt-pile-w: calc(var(--card-w) * 0.9);
  --felt-pile-h: calc(var(--card-h) * 0.9);
  justify-content: stretch;
  overflow: auto;
  padding: 4px;
  position: relative;
}
.felt.hand-cloth .hand-felt { width: 100%; height: 100%; }
.hand-piles {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}
.felt.hand-cloth .hand-piles {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 5;
  gap: 6px;
}
.pile-btn {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  color: inherit;
  min-width: 44px;
  min-height: 44px;
  position: relative;
}
.felt.hand-cloth .pile-btn .pcard,
.felt.hand-cloth .pile-empty {
  width: var(--felt-pile-w, var(--felt-card-w));
  height: var(--felt-pile-h, var(--felt-card-h));
  border-radius: 4px;
}
.pile-btn .lab {
  font-size: 10px;
  font-weight: 800;
  color: color-mix(in srgb, #fff 88%, var(--muted));
  background: color-mix(in srgb, var(--bg-deep) 72%, transparent);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.4;
}
.pile-btn.active-draw { filter: drop-shadow(0 0 8px var(--accent)); }
.pile-btn.blocked-draw { opacity: 0.55; cursor: default; }
.pile-empty {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 7px;
  background: color-mix(in srgb, #000 22%, transparent);
}
.meld-board {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: center;
  align-content: center;
  max-height: none;
  overflow: visible;
  min-height: 80px;
  height: 100%;
  padding: 10px 8px 12px;
  padding-inline-start: 148px;
  box-sizing: border-box;
}
.meld-set {
  display: flex;
  gap: 0;
  background: color-mix(in srgb, #000 22%, transparent);
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
  border-radius: 8px;
  padding: 4px 5px;
  cursor: pointer;
  align-items: flex-end;
}
.felt.hand-cloth .meld-set .pcard {
  width: var(--felt-card-w);
  height: var(--felt-card-h);
  border-radius: 5px;
  margin-inline-end: calc(var(--felt-card-w) * -1 * var(--felt-overlap, 0.48));
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.felt.hand-cloth .meld-set .pcard:last-child { margin-inline-end: 0; }
.meld-set.can-add { outline: 2px solid var(--accent); }
.meld-set.can-split { outline: 2px dashed var(--warn); }
.meld-set.can-move { outline: 2px solid var(--success); }
.pcard.felt-lift { cursor: pointer; }
.pcard.pick-felt {
  outline: 2px solid var(--warn);
  outline-offset: 1px;
  z-index: 4;
  transform: translateY(-6px);
}
.pcard.can-take-felt {
  outline: 2px solid var(--success);
  outline-offset: 1px;
}
.pcard.can-join {
  box-shadow: 0 0 0 2px var(--success);
}
.meld-owner { display: none; }
.face-row { display: flex; align-items: center; gap: 8px; z-index: 4; }
.felt .face-row {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 6;
  flex-direction: column;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.felt .face-row .kitty-lab {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--felt-ink, #f5f0e6) 72%, transparent);
}

.table-stage.view-hand .hand-dock { flex-shrink: 0; position: relative; padding-top: 8px; }
.table-stage.view-hand .felt.hand-cloth { flex: 1 1 0; min-height: 0; }
.table-stage.view-hand .hand-row .pcard { touch-action: none; }
.table-stage.view-hand .hand-flat {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  align-content: flex-end;
  gap: 10px 24px;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - var(--card-w) - 36px);
  overflow: visible;
  padding-inline: 8px;
  direction: ltr;
  --hand-overlap: 0.5;
}
.table-stage.view-hand .hand-flat::-webkit-scrollbar { display: none; }
.table-stage.view-hand .hand-chunk {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  padding: 32px 10px 8px;
  border-radius: 12px;
  isolation: isolate;
  position: relative;
}
.table-stage.view-hand .hand-loose {
  padding: 6px 4px 7px;
  background: transparent;
  box-shadow: none;
  cursor: default;
}
.table-stage.view-hand .hand-meld-g {
  margin-inline: 2px;
}
.table-stage.view-hand .chunk-lift {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  min-width: 48px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.table-stage.view-hand .chunk-lift-ico {
  font-size: 15px;
  line-height: 1;
  translate: 0 -1px;
}
.table-stage.view-hand .chunk-lift:hover,
.table-stage.view-hand .chunk-lift:active {
  filter: brightness(1.08);
}
.table-stage.view-hand .hand-meld-g.g0 {
  background: color-mix(in srgb, #38bdf8 46%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #38bdf8 78%, transparent);
}
.table-stage.view-hand .hand-meld-g.g1 {
  background: color-mix(in srgb, #34d399 46%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #34d399 78%, transparent);
}
.table-stage.view-hand .hand-meld-g.g2 {
  background: color-mix(in srgb, #fb923c 46%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #fb923c 78%, transparent);
}
.table-stage.view-hand .hand-meld-g.g3 {
  background: color-mix(in srgb, #a78bfa 46%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #a78bfa 78%, transparent);
}
.table-stage.view-hand .hand-flat .pcard {
  margin-inline-end: calc(var(--card-w) * -1 * var(--hand-overlap, 0.5));
  transition: transform 140ms ease;
}
.table-stage.view-hand .hand-chunk > .pcard:last-child { margin-inline-end: 0; }
.table-stage.view-hand .hand-flat .pcard.pcard-playable:hover,
.table-stage.view-hand .hand-flat .pcard.pcard-playable:active {
  transform: translateY(-8px);
}
.table-stage.view-hand .hand-flat .pcard.selected {
  transform: translateY(-12px);
  outline: 2px solid var(--warn);
  outline-offset: 1px;
  box-shadow: 0 -3px 0 var(--warn), 0 2px 8px rgba(0, 0, 0, 0.28);
}
.table-stage.view-hand .hand-flat .pcard.selected.pcard-playable:hover {
  transform: translateY(-12px);
}
.table-stage.view-hand .hand-row {
  direction: ltr;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  overflow-x: hidden;
  overflow-y: visible;
  gap: 0;
  width: 100%;
  scrollbar-width: none;
}
.table-stage.view-hand .hand-row::-webkit-scrollbar { display: none; }
.table-stage.view-hand .hand-drawn {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-inline-start: 10px;
  padding: 0 6px 0 12px;
  position: sticky;
  inset-inline-end: 0;
  z-index: 9;
  min-height: var(--card-h);
  border-inline-start: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
}
.hand-stage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 8px 0;
  flex-shrink: 0;
}
.hand-stage-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 16px 22px;
  direction: ltr;
}
.meld-set.staged {
  position: relative;
  --stage-w: calc(var(--card-w) * 2 / 3);
  --stage-h: calc(var(--card-h) * 2 / 3);
  --hand-overlap: 0.5;
  padding: 4px 6px 5px;
  margin: 0;
  background: color-mix(in srgb, #000 28%, transparent);
  outline: 2px dashed var(--warn);
  cursor: pointer;
  direction: ltr;
  flex-shrink: 0;
  isolation: isolate;
  overflow: visible;
}
.meld-set.staged .pcard,
.meld-set.staged .pcard.mini {
  width: var(--stage-w);
  height: var(--stage-h);
  margin-inline-end: calc(var(--stage-w) * -1 * var(--hand-overlap, 0.5));
  border-radius: 4px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.35);
}
.meld-set.staged .pcard:last-child { margin-inline-end: 0; }
.meld-set.staged .stage-pts {
  position: absolute;
  top: -8px;
  inset-inline-end: -4px;
  background: var(--warn);
  color: var(--bg-deep);
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 0 5px;
  line-height: 1.5;
  z-index: 6;
}
.table-stage.view-hand .hand-felt-actions {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, calc(-100% + 10px));
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0;
  min-height: 0;
  pointer-events: none;
  width: max-content;
  max-width: 96%;
}
.table-stage.view-hand .hand-felt-actions .btn,
.table-stage.view-hand .hand-felt-actions .hand-pts-chip,
.table-stage.view-hand .hand-felt-actions .need-run {
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.hand-open-chip {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hand-open-chip .chip-sep { opacity: 0.45; font-weight: 700; }
.hand-open-chip .chip-high { opacity: 0.92; }
.hand-open-chip .chip-bar { color: var(--accent); }
.hand-open-chip .chip-left { color: var(--warn); }
.hand-open-chip .chip-ok { color: var(--success); }
.hand-open-chip .chip-have { color: #fff; }
.hand-pts-chip {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.need-run {
  font-size: 12px;
  font-weight: 800;
  color: var(--warn);
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  border-radius: 999px;
  padding: 6px 10px;
}
.meld-set.pick-meld { outline: 2px solid var(--warn); }
.pcard.pick-joker {
  outline: 3px solid var(--warn);
  outline-offset: 2px;
  z-index: 8;
}
.pcard.can-swap {
  outline: 2px solid var(--success);
  outline-offset: 1px;
}
.pcard.felt-joker { cursor: pointer; }
.pcard.spare-joker {
  outline: 2px dashed var(--warn);
  outline-offset: 1px;
}
.pcard.just-drawn {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
  z-index: 6;
}
.hand-drawn .pcard,
.hand-drawn .pcard.just-drawn,
.hand-drawn button.pcard {
  width: var(--card-w);
  height: var(--card-h);
  transform: none;
}
.table-stage.view-hand .hand-drawn .pcard.pcard-playable:hover,
.table-stage.view-hand .hand-drawn .pcard.pcard-playable:active,
.table-stage.view-hand .hand-drawn .pcard.just-drawn,
.table-stage.view-hand .hand-drawn .pcard.selected {
  transform: none;
}
.pcard.just-drawn::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--card-face);
  z-index: 9;
}
.pcard.just-drawn.selected {
  box-shadow: 0 0 0 2px var(--warn), 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
}
.pcard.hand-src-drag { opacity: 0.35; }
.hand-zoom-btn {
  display: none;
}
.hand-sort-btn {
  display: grid;
  place-items: center;
  position: absolute;
  top: 0;
  inset-inline-end: 8px;
  z-index: 18;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.hand-sort-btn .ico { width: 20px; height: 20px; }
.hand-drag-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.hand-drag-ghost {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.92;
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  will-change: left, top;
}

@media (min-width: 860px) {
  .table-stage.view-hand .hand-dock { max-height: 42vh; }
  .table-stage.view-hand .hand-row { padding-block: 14px 4px; max-height: 34vh; }
  .felt.hand-cloth {
    min-height: 200px;
    --felt-card-w: 84px; --felt-card-h: 120px;
    --felt-pile-w: 63px; --felt-pile-h: 90px;
  }
  .felt.hand-cloth .meld-board { padding-inline-start: 168px; }
  .table-stage.view-hand .status-bar {
    gap: 6px;
    padding: 4px 8px 4px;
  }
  .table-stage.view-hand .player-status {
    padding: 5px 8px;
    border-radius: 9px;
  }
  .table-stage.view-hand .ps-head { margin-bottom: 2px; gap: 4px; }
  .table-stage.view-hand .ps-name { font-size: clamp(12px, 1.1vw, 15px); }
  .table-stage.view-hand .ps-board {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
  }
  .table-stage.view-hand .ps-metric {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    gap: 1px;
  }
  .table-stage.view-hand .ps-lab {
    font-size: 10px;
    letter-spacing: 0.02em;
  }
  .table-stage.view-hand .ps-num {
    font-size: clamp(15px, 1.5vw, 20px);
    padding: 2px 6px 3px;
    min-width: 1.4em;
  }
  .table-stage.view-hand .ps-metric.score .ps-num {
    font-size: clamp(17px, 1.7vw, 22px);
  }
  .table-stage.view-hand .ps-star { font-size: 12px; }
  .table-stage.view-hand .ps-opened { font-size: 11px; }
}
@media (min-width: 860px) and (max-height: 860px) {
  .table-stage.view-hand .ps-lab { display: none; }
  .table-stage.view-hand .player-status { padding: 4px 7px; }
  .table-stage.view-hand .status-bar { padding: 3px 6px; gap: 5px; }
  .table-stage.view-hand .ps-num { font-size: 14px; padding: 1px 5px; }
  .table-stage.view-hand .ps-metric.score .ps-num { font-size: 16px; }
  .table-stage.view-hand .ps-name { font-size: 12px; }
}

@media (max-width: 859px) {
  .felt.hand-cloth {
    min-height: 0;
    flex: 1 1 0;
    padding: 3px;
    --felt-card-w: 44px; --felt-card-h: 62px;
    --felt-pile-w: 36px; --felt-pile-h: 51px;
    --felt-overlap: 0.5;
  }
  .felt.hand-cloth .meld-board { padding: 6px 4px 8px; padding-inline-start: 92px; gap: 8px 10px; }
  .felt.hand-cloth .hand-piles { top: 6px; inset-inline-start: 6px; gap: 4px; }
  .table-stage.view-hand .hand-dock { max-height: calc(var(--card-h) * 2 + 96px); }
  .table-stage.view-hand .hand-row {
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    align-content: flex-end;
    overflow-x: hidden;
    overflow-y: visible;
    padding-block: 10px 6px;
    padding-inline: 6px;
    gap: 8px 0;
    width: 100%;
    max-height: none;
  }
  .table-stage.view-hand .hand-flat { display: contents; }
  .table-stage.view-hand .hand-loose { display: contents; }
  .table-stage.view-hand .hand-meld-g { flex-wrap: nowrap; max-width: 100%; }
  .table-stage.view-hand .hand-drawn {
    position: static;
    margin: 0;
    padding: 4px 6px 4px 10px;
    inset: auto;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-inline-start: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent);
    align-self: flex-end;
  }
  .table-stage.view-hand .status-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px;
    padding: 2px 4px;
  }
  .table-stage.view-hand .player-status {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 4px 5px 3px;
    border-radius: 8px;
    min-height: 0;
  }
  .table-stage.view-hand .ps-head { margin-bottom: 0; gap: 3px; min-width: 0; width: 100%; }
  .table-stage.view-hand .ps-name {
    font-size: 11px;
    letter-spacing: 0;
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.2;
    max-width: none;
  }
  .table-stage.view-hand .player-status .seat-pip { width: 8px; height: 8px; flex-shrink: 0; }
  .table-stage.view-hand .ps-board {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 0;
    width: 100%;
  }
  .table-stage.view-hand .ps-lab { display: none; }
  .table-stage.view-hand .ps-metric { min-height: 0; gap: 0; }
  .table-stage.view-hand .ps-num {
    font-size: 11px;
    padding: 1px 4px 1px;
    min-width: 1.2em;
    border-radius: 4px;
  }
  .table-stage.view-hand .ps-metric.score .ps-num { font-size: 12px; min-width: 1.3em; }
  .table-stage.view-hand .ps-star { font-size: 10px; }
  .table-stage.view-hand .ps-opened { font-size: 10px; }
  .table-stage.view-hand .info-bar { padding: 2px 6px 4px; }
  .table-stage.view-hand .table-msg { font-size: 12px; padding: 5px 12px; }
  .table-stage.view-hand .toolbar.hand-bar {
    flex-wrap: nowrap;
    padding: 4px 6px;
    gap: 6px;
  }
  .table-stage.view-hand .toolbar.hand-bar .scores {
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    flex: 1;
    justify-content: center;
  }
  .table-stage.view-hand .toolbar.hand-bar .score-chip,
  .table-stage.view-hand .toolbar.hand-bar .hand-open-chip {
    padding: 3px 8px;
    font-size: 11px;
  }
  .ps-opened {
    font-size: 11px;
    font-weight: 800;
    color: var(--success);
    line-height: 1;
  }
  .table-stage.view-hand .hand-zoom-btn {
    display: grid;
    place-items: center;
    position: absolute;
    top: 0;
    inset-inline-start: 8px;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    z-index: 18;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid color-mix(in srgb, #fff 28%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transform: translateY(-50%);
  }
  .table-stage.view-hand .hand-sort-btn {
    transform: translateY(-50%);
  }
  .table-stage.view-hand .hand-zoom-btn.on {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: transparent;
  }
  .table-stage.view-hand.hand-zoom .hand-dock {
    max-height: 58vh;
    flex: 1 1 52%;
    min-height: 46vh;
  }
  .table-stage.view-hand.hand-zoom .felt.hand-cloth {
    flex: 0 1 26%;
    min-height: 0;
  }
  .table-stage.view-hand.hand-zoom {
    --card-w: 54px;
    --card-h: 76px;
  }
  .table-stage.view-hand.hand-zoom .hand-row {
    max-height: none;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    align-content: flex-end;
    overflow-x: hidden;
    overflow-y: auto;
    padding-block: 14px 8px;
    padding-inline: 6px;
    gap: 10px 0;
    width: 100%;
  }
  .table-stage.view-hand.hand-zoom .hand-felt-actions {
    transform: translate(-50%, calc(-100% - 6px));
  }
  .table-stage.view-hand.hand-zoom .hand-flat {
    display: contents;
  }
  .table-stage.view-hand.hand-zoom .hand-loose {
    display: contents;
  }
  .table-stage.view-hand.hand-zoom .hand-meld-g {
    flex-wrap: nowrap;
    max-width: 100%;
  }
  .table-stage.view-hand.hand-zoom .hand-drawn {
    position: static;
    margin: 0;
    padding: 4px 6px 4px 10px;
    inset: auto;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-inline-start: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent);
    align-self: flex-end;
  }
  .table-stage.view-hand.hand-zoom .hand-dock { padding-top: 8px; }
  .table-stage.view-hand .end-card.tx-end {
    width: min(300px, 96%);
    padding: 10px 12px 12px;
    border-radius: 12px;
  }
  .table-stage.view-hand .end-card.tx-end h3 {
    font-size: 15px;
    margin: 0 0 6px;
  }
  .table-stage.view-hand .tx-end-contract {
    font-size: 12px;
    margin: 0 0 6px;
  }
  .table-stage.view-hand .tx-end-rows {
    gap: 4px;
    margin: 2px 0 8px;
  }
  .table-stage.view-hand .tx-end-row {
    padding: 4px 8px;
    border-radius: 8px;
    gap: 8px;
  }
  .table-stage.view-hand .tx-end-who { font-size: 13px; }
  .table-stage.view-hand .tx-end-d { font-size: 15px; }
  .table-stage.view-hand .end-card.tx-end .btn { padding: 8px 16px; font-size: 14px; }
}

@media (max-width: 639px) {
  .felt.hand-cloth {
    --felt-card-w: 34px; --felt-card-h: 48px;
    --felt-pile-w: 30px; --felt-pile-h: 42px;
    border-width: 7px;
    border-radius: 12px;
    min-height: 0;
  }
  .felt.hand-cloth .meld-board { padding-inline-start: 76px; gap: 6px 8px; }
  .felt.hand-cloth .meld-set { padding: 3px 3px; border-radius: 6px; }
  .felt.hand-cloth .pile-btn .lab { font-size: 9px; padding: 0 4px; }
  .pcard .seat-pip-wrap { width: 10px; height: 10px; left: 1px; bottom: 1px; }
}

.side-log-wrap {
  display: flex; width: 100%; flex-direction: column; min-height: 0; height: 100%;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
}
.side-log-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}
.side-log-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; }
.side-log { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 8px 12px; font-size: 12px; color: var(--muted); min-height: 0; flex: 1; }
.log-line { padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent); line-height: 1.4; overflow-wrap: anywhere; }
.log-line.kind-trick {
  display: flex;
  align-items: center;
  gap: 6px 8px;
  flex-wrap: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
}
.log-line.kind-trick .log-pips {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 0 0 auto;
}
.log-line.kind-trick .name-chip {
  margin-inline-start: 0;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-line.kind-trick .log-note {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-mini-card {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 24px; height: 32px; border-radius: 4px; font-size: 9px; font-weight: 800;
  border: 1.5px solid #cbd5e1; background: #fffef8; color: #0f172a; margin: 0; vertical-align: middle;
  position: relative;
}
.log-mini-card.win { z-index: 1; }
.log-mini-card.win::after {
  content: "★";
  position: absolute;
  top: 1px;
  inset-inline-end: 1px;
  font-size: 8px;
  line-height: 1;
  color: #e8b923;
  pointer-events: none;
}
.log-mini-card.red { color: #dc2626; }
.log-mini-card.p0 { border-color: #38bdf8; }
.log-mini-card.p1 { border-color: #fb923c; }
.log-mini-card.p2 { border-color: #4ade80; }
.log-mini-card.p3 { border-color: #a78bfa; }
.log-mini-card.p4 { border-color: #f472b6; }
.log-mini-card.p5 { border-color: #facc15; }
.name-chip { display: inline-block; font-weight: 700; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: var(--surface-2); }
.name-chip.us, .name-chip.p0 { color: var(--team-us); }
.name-chip.them, .name-chip.p1 { color: var(--team-them); }
.name-chip.p2 { color: #4ade80; }
.name-chip.p3 { color: #c4b5fd; }
.table-stage.view-teams .name-chip.p0,
.table-stage.view-teams .name-chip.p2,
.table-stage.view-teams .name-chip.p4 { color: var(--team-us); }
.table-stage.view-teams .name-chip.p1,
.table-stage.view-teams .name-chip.p3,
.table-stage.view-teams .name-chip.p5 { color: var(--team-them); }
.table-stage.view-teams .log-mini-card.p0,
.table-stage.view-teams .log-mini-card.p2,
.table-stage.view-teams .log-mini-card.p4 { border-color: var(--team-us); }
.table-stage.view-teams .log-mini-card.p1,
.table-stage.view-teams .log-mini-card.p3,
.table-stage.view-teams .log-mini-card.p5 { border-color: var(--team-them); }
.score-rail { border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); font-size: 11px; padding-bottom: 8px; }
.score-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.score-row.wrap { flex-wrap: wrap; gap: 4px; }

.suit-counter {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: 4px 2px; padding: 4px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 6%, transparent);
  font-variant-numeric: tabular-nums;
}
.suit-item {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 2.8em; padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.suit-item b { color: var(--fg); font-size: 14px; font-weight: 800; }
.suit-item.red { color: var(--danger); }
.suit-item.red b { color: var(--danger); }
.suit-item.trump {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  outline: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--warn);
}
.suit-item.trump b { color: var(--warn); }
.suit-item.joker { color: var(--accent); }
.suit-item.joker b { color: var(--accent); }

.suit-pick { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 24px; }
.suit-pick.red { color: var(--danger); }
.suit-pick.blk { color: var(--fg); }
.suit-pick.on { outline: 2px solid var(--accent); }

.sg-ex-overlay {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 9;
  width: min(94%, 420px);
  pointer-events: none;
}
.sg-ex-brief {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 8px 14px;
  text-align: start;
  box-shadow: 0 10px 28px rgba(0,0,0,.36);
}
.sg-ex-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.sg-ex-line { font-size: 13px; line-height: 1.35; margin: 2px 0; }
.sg-ex-line.you { font-weight: 800; color: var(--warn); }
.sg-ex-line.other { color: var(--fg); opacity: 0.92; }
.bk-pop .sg-ex-brief {
  margin: 8px auto 0;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  box-shadow: none;
  border-width: 1px;
}
.felt.has-kitty .sg-ex-overlay { bottom: 8px; }
@media (min-width: 860px) {
  .sg-ex-overlay { width: min(90%, 460px); }
  .sg-ex-line { font-size: 15px; }
}
.suit-pick:has(.suit-nm) {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: auto; min-width: 68px; height: 66px; padding: 6px 10px; font-size: 22px;
}
.suit-pick .suit-nm {
  font-size: 11px; font-weight: 700; line-height: 1.1; letter-spacing: 0.01em;
}

.pcard.suggested { outline: 2px solid var(--success); outline-offset: 1px; overflow: visible; isolation: auto; z-index: 6; }
button.pcard.suggested { overflow: visible; isolation: auto; }
.pcard.suggested-1 { outline-color: var(--success); }
.pcard.suggested-2 { outline-color: #22d3ee; }
.pcard.suggested-3 { outline-color: #a78bfa; }
.think-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 24;
  min-width: 2.6em;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  background: #155e75;
  color: #cffafe;
  border-radius: 999px;
  padding: 3px 7px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.45);
}
.pcard.suggested-2 .think-badge { background: #155e75; }
.pcard.suggested-3 .think-badge { background: #5b21b6; color: #ede9fe; }
.pts-pip {
  position: absolute;
  left: 3px;
  bottom: 3px;
  z-index: 6;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(12, 18, 28, 0.84);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.pts-pip.zero { background: rgba(12, 18, 28, 0.5); color: rgba(255,255,255,.78); }
.trick-p .pts-pip { min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }
.changelog { max-height: 60vh; overflow: auto; text-align: start; }
.changelog-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.changelog-item:last-child { border-bottom: 0; }
.changelog-ver { font-size: 11px; font-weight: 800; color: var(--accent); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.changelog-item p { margin: 0; font-size: 13px; line-height: 1.45; }
.chg-tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
}
.chg-tag.feature { background: rgba(56,189,248,0.2); color: #7dd3fc; }
.chg-tag.logic { background: rgba(167,139,250,0.22); color: #c4b5fd; }
.chg-tag.ui { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.suit-pick.suggested-trump { outline: 2px solid var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 35%, transparent); }
.status-bar { font-size: 11px; }
.hand-row { max-height: 32vh; }

@media (min-width: 860px) {
  .felt { min-height: 220px; }
  .think-badge {
    top: -16px;
    font-size: 14px;
    min-width: 2.9em;
    padding: 4px 9px;
  }
}

@media (max-width: 859px) {
  .table-stage { overflow: hidden; }
  .stage-board { overflow: hidden; }
  .felt { min-height: 110px; margin: 0 6px 6px; border-radius: 14px; }
  .felt.seats-6 { min-height: 180px; }
  .hand-dock { max-height: calc(var(--card-h) * 2 + 96px); }
  .hand-suit { display: contents; }
  .hand-row {
    max-height: calc(var(--card-h) * 2 + 28px);
    gap: 6px 4px;
    padding-block: 18px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    align-items: flex-end;
    align-content: flex-end;
  }
  .hand-dock:has(.actions:not(:empty) button) .hand-row {
    max-height: calc(var(--card-h) * 2 + 28px);
  }
  .think-badge {
    top: -12px;
    font-size: 11px;
    min-width: 2.3em;
    padding: 2px 6px;
  }
  .info-bar { padding: 2px 8px 6px; }
  .table-msg { font-size: 13px; padding: 7px 14px; max-width: 98%; }
  .seat-chip { font-size: 10px; padding: 3px 6px 3px 3px; }
  .trick-area { width: min(100%, 96%); gap: 4px 6px; padding: 4px; }
  .kitty-row { gap: 4px; }
  .meld-board { max-height: none; }
}

@media (max-width: 639px) {
  .status-bar.n4 { grid-template-columns: 1fr 1fr !important; }
  .status-bar.n6 { grid-template-columns: 1fr 1fr 1fr !important; overflow-x: auto; }
  .status-bar.n2 { grid-template-columns: 1fr 1fr !important; }
  .status-bar { gap: 5px; padding: 4px 6px 6px; }
  .player-status { padding: 6px 6px 7px; border-radius: 8px; }
  .ps-head { margin-bottom: 4px; }
  .ps-name { font-size: 14px; }
  .ps-star { font-size: 13px; }
  .ps-king { font-size: 9px; padding: 1px 5px; }
  .ps-king-done { font-size: 12px; }
  .ps-delta { font-size: 11px; }
  .ps-lab { font-size: 11px; letter-spacing: 0.02em; }
  .ps-metric { min-height: 24px; gap: 4px; }
  .ps-num { font-size: 16px; padding: 2px 5px 3px; }
  .ps-metric.score .ps-num { font-size: 22px; }
  .ps-metric.tally .ps-num { font-size: 16px; }
  .suit-pick { width: 44px; height: 44px; font-size: 20px; }
  .suit-pick:has(.suit-nm) { min-width: 58px; height: 58px; font-size: 18px; }
  .suit-pick .suit-nm { font-size: 9px; }
  .hand-dock { padding-inline: 4px; }
}

.bk-pop-mask {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(7, 12, 22, 0.62);
  cursor: pointer;
  animation: bkPopFade 280ms ease;
}
.bk-pop {
  width: min(380px, 92%);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 18px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  color: var(--fg);
}
.bk-pop::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background-color: var(--accent);
  -webkit-mask: var(--gulf-wave) repeat-x center / 88px 11px;
  mask: var(--gulf-wave) repeat-x center / 88px 11px;
}
.bk-pop.team-us::after { background-color: var(--team-us); }
.bk-pop.team-them::after { background-color: var(--team-them); }
.bk-pop-kicker {
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.bk-pop-side {
  display: inline-block;
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px; border-radius: 999px;
  margin: 2px 0 4px;
}
.bk-pop.team-us .bk-pop-side {
  color: var(--team-us);
  background: color-mix(in srgb, var(--team-us) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--team-us) 50%, transparent);
}
.bk-pop.team-them .bk-pop-side {
  color: var(--team-them);
  background: color-mix(in srgb, var(--team-them) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--team-them) 50%, transparent);
}
.bk-pop.team-us .bk-pop-buyer { color: var(--team-us); }
.bk-pop.team-them .bk-pop-buyer { color: var(--team-them); }
.bk-pop-buyer {
  font-size: 26px; font-weight: 800; line-height: 1.2; margin: 4px 0 8px;
}
.bk-pop-bid {
  display: inline-block;
  font-size: 22px; font-weight: 800;
  padding: 6px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  margin-bottom: 10px;
}
.bk-pop.team-us .bk-pop-bid {
  background: color-mix(in srgb, var(--team-us) 22%, transparent);
  border-color: color-mix(in srgb, var(--team-us) 55%, transparent);
}
.bk-pop.team-them .bk-pop-bid {
  background: color-mix(in srgb, var(--team-them) 22%, transparent);
  border-color: color-mix(in srgb, var(--team-them) 55%, transparent);
}
.bk-pop-hukm { font-size: 16px; font-weight: 700; margin: 4px 0 12px; }
.bk-pop-lead { font-size: 18px; font-weight: 800; margin-top: 8px; }
.bk-pop-note { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.bk-pop-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 8px;
}
.bk-pop-cards .pcard {
  width: calc(var(--card-w) * 0.92);
  height: calc(var(--card-h) * 0.92);
}
.bk-pop-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.bk-pop.celeb { padding-top: 26px; padding-bottom: 24px; }
.bk-pop-title { font-size: 32px; font-weight: 800; line-height: 1.15; margin: 4px 0 8px; }
.bk-pop-team {
  font-size: 20px; font-weight: 800;
  padding: 4px 14px; border-radius: 999px; display: inline-block;
}
.bk-pop.team-us .bk-pop-team { color: var(--team-us); }
.bk-pop.team-them .bk-pop-team { color: var(--team-them); }
.bk-pop-kout { font-size: 15px; font-weight: 800; margin-top: 8px; letter-spacing: 0.08em; }
.bk-pop.won { box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 55%, transparent), 0 24px 60px rgba(0,0,0,.45); }
.bk-pop.fell { box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 45%, transparent), 0 24px 60px rgba(0,0,0,.45); }
.bk-burst {
  display: flex; justify-content: center; gap: 14px;
  font-size: 22px; margin-bottom: 8px;
}
.bk-burst span:nth-child(2),
.bk-burst span:nth-child(4) { color: var(--danger); }
.bk-pop.celeb .bk-burst span {
  animation: bkPip 900ms ease-in-out infinite;
}
.bk-burst span:nth-child(2) { animation-delay: 120ms; }
.bk-burst span:nth-child(3) { animation-delay: 240ms; }
.bk-burst span:nth-child(4) { animation-delay: 360ms; }
@keyframes bkPopFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes bkPip {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-6px) scale(1.15); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-pop-mask, .bk-pop.celeb .bk-burst span { animation: none; }
}

.tally-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 6px;
  padding: 4px 10px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
  width: auto;
  max-width: calc(100% - 20px);
  align-self: center;
  font: inherit;
}
.tally-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.tally-who { font-size: 13px; font-weight: 800; line-height: 1; }
.tally-num {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.02em;
  margin-inline-start: auto;
}
.tally-den { font-size: 0.72em; color: var(--muted); font-weight: 800; margin-inline-start: 1px; }
.tally-goal {
  font-size: 11px; font-weight: 800; color: var(--muted);
  line-height: 1.2; white-space: nowrap;
  padding-inline-start: 8px;
  border-inline-start: 1px solid var(--border);
}
.tally-bar.team-us { border-color: color-mix(in srgb, var(--team-us) 50%, var(--border)); }
.tally-bar.team-us .tally-who,
.tally-bar.team-us .tally-num { color: var(--team-us); }
.tally-bar.team-them { border-color: color-mix(in srgb, var(--team-them) 50%, var(--border)); }
.tally-bar.team-them .tally-who,
.tally-bar.team-them .tally-num { color: var(--team-them); }

.trick-p.buyer .trick-name {
  color: #38bdf8;
  border: 1px solid color-mix(in srgb, #38bdf8 65%, transparent);
  background: color-mix(in srgb, #38bdf8 16%, var(--bg-mid));
}
.trick-p.buyer .pcard,
.trick-p.buyer .trick-slot {
  box-shadow: 0 0 0 2px #38bdf8;
}
.buyer-mark {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(#7dd3fc, #0284c7);
  color: #082f49;
  border: 1px solid #0369a1;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.35;
  flex-shrink: 0;
}
.dealer-mark {
  display: inline-block;
  margin: 0;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1c1406;
  background: linear-gradient(#fde68a, #d97706);
  border: 1px solid #92400e;
  vertical-align: middle;
  flex-shrink: 0;
}
.trick-p.buyer.dealer .trick-name,
.trick-p.buyer .trick-name,
.trick-p.dealer .trick-name {
  border-radius: 12px;
  white-space: normal;
}
.trick-p.buyer.dealer .trick-who {
  flex: 1 0 100%;
  text-align: center;
  max-width: none;
}
.ts-player.buyer {
  box-shadow: 0 0 0 2px color-mix(in srgb, #38bdf8 75%, transparent);
  color: #38bdf8;
}
.ts-player.dealer:not(.buyer) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 90%, transparent);
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--warn);
}
.dealer-puck {
  position: absolute;
  top: -10px;
  inset-inline-end: -8px;
  z-index: 6;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  color: #1c1406;
  background: radial-gradient(circle at 35% 30%, #fef3c7, #d97706);
  border: 2px solid #78350f;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  pointer-events: none;
}
.seat.dealer .seat-chip {
  color: var(--warn);
  border-color: var(--warn);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 45%, transparent);
}
.seat .dealer-puck { position: static; width: 18px; height: 18px; font-size: 11px; margin-inline-start: 4px; }
.trick-p.dealer:not(.buyer) .trick-name { color: var(--warn); font-weight: 800; }
.cut-area {
  position: absolute;
  inset: 6px;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.cut-card {
  --cut-w: 34px;
  --cut-h: 48px;
  position: absolute;
  width: var(--cut-w);
  height: var(--cut-h);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: cut-throw 0.38s ease-out both;
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
  overflow: visible;
}
.cut-card .pcard,
.cut-card .pcard img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}
.cut-card .pcard { overflow: hidden; border-radius: 6px; }
.cut-card .pcard img { z-index: 1; }
.cut-area.is-live .cut-card { animation: none; }
.cut-card.down { z-index: 2; }
.cut-card.pickable { cursor: pointer; z-index: 3; }
.cut-card.flipped,
.cut-card.taken {
  --cut-w: 52px;
  --cut-h: 74px;
  z-index: 8;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.45));
  transition: left 0.32s ease, top 0.32s ease, transform 0.32s ease;
}
.cut-who {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 5px;
  top: auto;
  transform: none;
  z-index: 10;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(8, 12, 24, .9);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.cut-who::after { display: none; }
.cut-who.team-us { background: color-mix(in srgb, var(--team-us) 90%, #000); }
.cut-who.team-them { background: color-mix(in srgb, var(--team-them) 90%, #000); }
.cut-who.you { background: color-mix(in srgb, var(--accent) 88%, #000); }
.cut-who.ai { background: rgba(8, 12, 24, .9); }
@keyframes cut-throw {
  from { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0deg) - 40deg)) scale(0.2); opacity: 0; }
  to { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); opacity: 1; }
}
@media (min-width: 860px) {
  .cut-card { --cut-w: 51px; --cut-h: 72px; }
  .cut-card.flipped, .cut-card.taken { --cut-w: 64px; --cut-h: 90px; }
  .cut-who { font-size: 11px; bottom: 6px; }
}
@media (max-width: 859px) {
  .cut-card { --cut-w: 28px; --cut-h: 40px; }
  .cut-card.flipped, .cut-card.taken { --cut-w: 44px; --cut-h: 62px; }
  .cut-who { font-size: 9px; }
}

@media (max-width: 859px) {
  .page-bkout .table-stage .toolbar { padding: 6px 8px; gap: 4px; }
  .page-bkout .table-stage .felt,
  .page-bkout .table-stage .felt.seats-6 {
    min-height: 0;
  }
  .page-bkout .table-stage .trick-area.seats-6 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    gap: 14px 16px;
    padding: 10px 8px 14px;
    position: relative;
    overflow: visible;
  }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 auto;
    gap: 4px;
    overflow: visible;
    justify-self: center;
  }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p0 { grid-column: 2; grid-row: 2; transform: translateY(10px); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p1 { grid-column: 3; grid-row: 2; transform: translate(4px, 4px); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p2 { grid-column: 3; grid-row: 1; transform: translate(4px, 6px); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p3 { grid-column: 2; grid-row: 1; transform: translateY(-8px); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p4 { grid-column: 1; grid-row: 1; transform: translate(-4px, 6px); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p5 { grid-column: 1; grid-row: 2; transform: translate(-4px, 4px); }
  .page-bkout .table-stage .felt.seats-4 { min-height: 0; }
  .page-bkout .table-stage .trick-area.seats-4 {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    gap: 10px 14px;
    padding: 10px 8px 14px;
    position: relative;
    overflow: visible;
  }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 auto;
    gap: 4px;
    overflow: visible;
    justify-self: center;
  }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p0 { grid-column: 2; grid-row: 3; transform: translateY(8px); }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p1 { grid-column: 1; grid-row: 2; transform: translate(-6px, 0); }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p2 { grid-column: 2; grid-row: 1; transform: translateY(-8px); }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p3 { grid-column: 3; grid-row: 2; transform: translate(6px, 0); }
  .page-bkout .table-stage.view-kout .trick-area.seats-4 .trick-p1 { grid-column: 3; grid-row: 2; transform: translate(6px, 0); }
  .page-bkout .table-stage.view-kout .trick-area.seats-4 .trick-p3 { grid-column: 1; grid-row: 2; transform: translate(-6px, 0); }
  .page-bkout .table-stage.view-baloot .trick-p.team-us .pcard,
  .page-bkout .table-stage.view-baloot .trick-p.team-us .trick-slot {
    width: calc(var(--card-w) * 1.65);
    height: calc(var(--card-h) * 1.65);
  }
  .page-bkout .table-stage.view-baloot .trick-p.team-them .pcard,
  .page-bkout .table-stage.view-baloot .trick-p.team-them .trick-slot {
    width: calc(var(--card-w) * 1.26);
    height: calc(var(--card-h) * 1.26);
  }
  .page-bkout .table-stage.view-baloot .trick-p:not(.team-us):not(.team-them) .pcard,
  .page-bkout .table-stage.view-baloot .trick-p:not(.team-us):not(.team-them) .trick-slot,
  .page-bkout .table-stage.view-baloot .face-row .pcard {
    width: calc(var(--card-w) * 1.5);
    height: calc(var(--card-h) * 1.5);
  }
  .page-bkout .table-stage.view-baloot .trick-p.team-us { min-width: calc(var(--card-w) * 1.65); }
  .page-bkout .table-stage.view-baloot .trick-p.team-them { min-width: calc(var(--card-w) * 1.26); }
  .page-bkout .table-stage.view-baloot .felt {
    overflow: visible;
  }
  .page-bkout .table-stage.view-baloot .trick-area.seats-4 {
    gap: 0 8px;
    padding: 2px 4px 6px;
    align-items: center;
  }
  .page-bkout .table-stage.view-baloot .trick-area.seats-4 .trick-p {
    gap: 2px;
  }
  .page-bkout .table-stage.view-baloot .trick-area.seats-4 .trick-p0 {
    transform: translateY(-14px);
    z-index: 3;
  }
  .page-bkout .table-stage.view-baloot .trick-area.seats-4 .trick-p2 {
    transform: translateY(14px);
    z-index: 3;
  }
  .page-bkout .table-stage.view-baloot .trick-name {
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: min(140px, 42vw);
    overflow: visible;
  }
  .page-bkout .table-stage.view-baloot .trick-who {
    max-width: 7em;
  }
  .page-bkout .table-stage .trick-area.seats-4 .trix-ladders {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    padding: 0;
  }
  .page-bkout .table-stage .trick-name {
    max-width: min(200px, 92%);
    font-size: 10px;
    padding: 2px 6px;
    overflow: visible;
  }
  .page-bkout .table-stage .hand-dock {
    max-height: none;
  }
  .page-bkout .table-stage .hand-row,
  .page-bkout .table-stage .hand-dock:has(.actions:not(:empty) button) .hand-row {
    max-height: min(32vh, 210px);
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    align-content: flex-end;
    gap: 8px 6px;
    padding-block: 18px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .page-bkout .table-stage .hand-suit {
    display: contents;
  }
  .page-bkout .table-stage .actions { padding: 8px 6px 4px; gap: 6px; }
  .page-bkout .table-stage .actions .btn { min-height: 40px; }
}

@media (max-width: 639px) {
  .tally-bar { margin: 0 6px 4px; padding: 3px 9px; min-height: 28px; gap: 6px; }
  .tally-num { font-size: 16px; }
  .tally-goal { font-size: 10px; }
  .page-bkout .table-stage .status-bar { padding: 2px 6px 6px; }
  .page-bkout .table-stage .team-status { padding: 5px 6px 6px; }
  .page-bkout .table-stage .info-bar { padding: 2px 6px 4px; }
  .page-bkout .table-stage .table-msg { font-size: 12px; padding: 6px 12px; }
}

.page-bkout .header { }
@media (max-width: 859px) {
  .page-bkout .header { display: none; }
  .bk-hukm-corner { min-width: 48px; padding: 5px 7px 4px; top: 6px; inset-inline-start: 6px; }
  .bk-hukm-corner .bk-hukm-sym { font-size: 26px; }
  .page-bkout .table-stage .win-arm { width: 22px; height: 22px; top: -6px; inset-inline-end: -8px; }
  .win-arm .ico { width: 13px; height: 13px; }
}

.bk-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; flex-wrap: nowrap;
  position: relative;
}
.bk-scorechip {
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800;
  min-height: 32px; display: inline-flex; align-items: center; gap: 4px;
  flex: 1; justify-content: center; min-width: 0;
}
.bk-scorechip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bk-scorechip.us { color: var(--team-us); border-color: color-mix(in srgb, var(--team-us) 45%, var(--border)); }
.bk-scorechip.them { color: var(--team-them); border-color: color-mix(in srgb, var(--team-them) 45%, var(--border)); }
.bk-scorechip.tally span { color: var(--muted); font-size: 10px; }
.bk-scorechip.tally.team-us b { color: var(--team-us); }
.bk-scorechip.tally.team-them b { color: var(--team-them); }
.bk-hukm-corner {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 8px 5px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-deep) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--border));
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  pointer-events: none;
}
.bk-hukm-corner .bk-hukm-sym {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  color: var(--warn);
}
.bk-hukm-corner.red .bk-hukm-sym { color: #f87171; }
.bk-hukm-corner.blk .bk-hukm-sym { color: var(--fg); }
.bk-hukm-corner .bk-hukm-nm {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 2px;
}
.bk-hukm-bid {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 900;
  color: var(--warn);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.bk-hukm-corner.trix-contract .bk-hukm-nm {
  max-width: 72px;
  text-align: center;
  line-height: 1.15;
}
.bk-hukm-corner.trix-contract {
  min-width: 58px;
  padding: 7px 8px 6px;
}
.bk-hukm-corner .tx-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.bl-proj-felt {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
  max-width: min(150px, 44%);
}
.table-stage.view-baloot .felt { overflow: visible; }
.bl-proj-felt-item {
  background: color-mix(in srgb, var(--bg-deep) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  border-radius: 10px;
  padding: 3px 5px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}
.bl-proj-felt-item.team-us { border-color: color-mix(in srgb, var(--team-us) 55%, transparent); }
.bl-proj-felt-item.team-them { border-color: color-mix(in srgb, var(--team-them) 55%, transparent); }
.bl-proj-felt-item.dropped { opacity: 0.42; filter: grayscale(.35); }
.bl-proj-felt-item.dropped .bl-proj-felt-kind { color: var(--muted); }
.bl-proj-felt-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}
.bl-proj-felt-who {
  font-size: 9px;
  font-weight: 800;
  color: var(--fg);
  max-width: 6.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bl-proj-felt-kind {
  font-size: 9px;
  font-weight: 800;
  color: var(--warn);
  white-space: nowrap;
}
.bl-proj-felt-cards {
  display: flex;
  margin-top: 3px;
  direction: ltr;
}
.bl-proj-felt-cards .pcard,
.bl-proj-felt-cards button.pcard,
.bl-proj-felt-cards button.pcard.mini {
  width: 20px;
  height: 28px;
  border-radius: 3px;
  margin-inline-end: -9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.45);
  pointer-events: none;
  flex-shrink: 0;
}
.bl-proj-felt-cards .pcard:last-child { margin-inline-end: 0; }
@media (max-width: 639px) {
  .bl-proj-felt { top: 4px; inset-inline-end: 4px; max-width: min(118px, 38%); gap: 3px; }
  .bl-proj-felt-item { padding: 2px 4px 3px; border-radius: 8px; }
  .bl-proj-felt-who, .bl-proj-felt-kind { font-size: 8px; }
  .bl-proj-felt-cards .pcard,
  .bl-proj-felt-cards button.pcard,
  .bl-proj-felt-cards button.pcard.mini {
    width: 16px;
    height: 22px;
    margin-inline-end: -7px;
  }
}
.tx-ico-face {
  width: 32px;
  height: 46px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: block;
}
.tx-ico-pip {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}
.tx-ico-pip.red { color: #f87171; }
.tx-ico-q {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: #f87171;
  font-family: Georgia, "Times New Roman", serif;
}
.tx-ico-stack {
  position: relative;
  width: 28px;
  height: 34px;
  display: block;
}
.tx-ico-stack i {
  position: absolute;
  width: 20px;
  height: 28px;
  border-radius: 3px;
  background: #eaf0ff url("../cards/back.svg") center / 100% 100% no-repeat;
  border: 1px solid #1e3a8a;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.tx-ico-stack i:nth-child(1) { left: 0; top: 4px; transform: rotate(-14deg); }
.tx-ico-stack i:nth-child(2) { left: 4px; top: 2px; transform: rotate(-2deg); }
.tx-ico-stack i:nth-child(3) { left: 8px; top: 0; transform: rotate(10deg); }
.bk-hukm-corner.doubled { border-color: color-mix(in srgb, var(--warn) 80%, #fff); }
.tx-dbl {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
  color: var(--warn);
}
.tx-dbl-who {
  margin-top: 1px;
  max-width: 72px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--warn);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taken-pile {
  display: flex; gap: 2px; justify-content: center; flex-wrap: nowrap;
  min-height: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}
.trick-p0 .taken-pile { top: calc(100% + 4px); }
.trick-p1 .taken-pile { top: 8px; left: auto; right: calc(100% + 6px); transform: none; }
.trick-p2 .taken-pile { bottom: calc(100% + 4px); top: auto; }
.trick-p3 .taken-pile { top: 8px; left: calc(100% + 6px); transform: none; }
.taken-pile .pcard {
  width: 28px; height: 40px;
  transform: rotate(-8deg);
}
.taken-pile .pcard + .pcard { margin-inline-start: -10px; transform: rotate(6deg); }
.table-stage.view-sabeeta .trick-p .taken-pile.sb-trophies {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  z-index: 6;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
  order: 3;
}
.table-stage.view-sabeeta .trick-p .trick-name { order: 2; }
.table-stage.view-sabeeta .trick-p0 .taken-pile.sb-trophies,
.table-stage.view-sabeeta .trick-p1 .taken-pile.sb-trophies,
.table-stage.view-sabeeta .trick-p2 .taken-pile.sb-trophies,
.table-stage.view-sabeeta .trick-p3 .taken-pile.sb-trophies {
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
}
.sb-pass-corner {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 8px 7px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  pointer-events: none;
}
.sb-pass-lab {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  max-width: 110px;
}
.sb-pass-cards {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.sb-pass-corner button.pcard.mini,
.sb-pass-corner .pcard.mini {
  width: 26px;
  height: 36px;
  border-radius: 4px;
  pointer-events: none;
}
.sb-hearts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  margin-inline-end: 0;
  border-radius: 999px;
  background: #9f1239;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  transform: none;
}
.taken-pile .sb-hearts + .pcard { margin-inline-start: 2px; }
.tx-pts {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 11px;
  color: var(--warn);
  margin-inline-start: 4px;
}
.tx-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.tx-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  min-height: 72px;
  padding: 8px 10px 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--fg);
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}
.tx-pick:hover, .tx-pick:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.tx-pick-ico { min-height: 36px; display: flex; align-items: center; justify-content: center; }
.tx-pick-ico .tx-ico-face { width: 28px; height: 40px; }
.tx-pick-nm { max-width: 78px; text-align: center; line-height: 1.15; }
.kh-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 5;
  padding: 10px 12px;
  width: min(520px, 94%);
}
.kh-show-lab {
  font-size: 13px;
  font-weight: 800;
  color: var(--warn);
  text-align: center;
}
.kh-show-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.kh-show-row .pcard { width: 36px; height: 52px; }
.trick-area .trix-ladders {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 92%);
  z-index: 2;
  padding: 6px;
  gap: 8px;
  pointer-events: none;
}
.end-card.tx-end { width: min(340px, 92%); text-align: center; }
.tx-end-contract {
  font-size: 13px;
  font-weight: 800;
  color: var(--warn);
  margin: 2px 0 10px;
}
.tx-end-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 14px;
  text-align: start;
}
.tx-end-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
  border: 1px solid var(--border);
}
.tx-end-who { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-end-d { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; }
.tx-end-d.up { color: var(--success); }
.tx-end-d.down { color: var(--danger); }
.bk-won {
  position: absolute;
  bottom: 22px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  max-width: 42%;
}
.bk-won.team-us { inset-inline-start: 28px; }
.bk-won.team-them { inset-inline-end: 28px; flex-direction: row-reverse; }
.won-back {
  width: 24px;
  height: 34px;
  border-radius: 3px;
  margin-inline-end: -13px;
  transform: rotate(calc((var(--i, 0) - 1.5) * 5deg));
  transform-origin: 50% 100%;
  background: #eaf0ff url("../cards/back.svg") center / 100% 100% no-repeat;
  border: 1px solid #1e3a8a;
  box-shadow: 0 1px 3px rgba(0,0,0,.45);
  position: relative;
  flex-shrink: 0;
}
.won-back::after { display: none; }
.won-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px 2px;
  padding: 2px 7px;
  border-radius: 999px;
  font: 800 10px/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: color-mix(in srgb, var(--back-a, #0c3a56) 90%, #000);
  color: var(--back-ink, #7dd3fc);
  border: 1px solid color-mix(in srgb, var(--back-ink, #7dd3fc) 45%, transparent);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  flex-shrink: 0;
  z-index: 2;
}
.won-who { text-transform: uppercase; letter-spacing: 0.06em; font-size: 8px; opacity: 0.92; }
.won-n { font-variant-numeric: tabular-nums; font-size: 11px; }
.bk-won.team-us { --back-a: #0c3a56; --back-b: #156489; --back-ink: #7dd3fc; }
.bk-won.team-them { --back-a: #4a1c08; --back-b: #9a3412; --back-ink: #fdba74; }
@media (max-width: 859px) {
  .bk-won { bottom: 28px; }
  .bk-won.team-us { inset-inline-start: 32px; }
  .bk-won.team-them { inset-inline-end: 32px; }
  .won-back { width: 18px; height: 26px; margin-inline-end: -10px; }
  .won-tag { font-size: 9px; padding: 1px 6px; }
  .bk-hukm-bid { font-size: 11px; }
  .table-stage:is(.view-kout, .view-bkout):has(.felt.seats-6) .bk-names-row { display: none; }

  /* K6K + K6B: hex on phones (overrides page-bkout's 2×3 grid) */
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 {
    display: block;
    position: relative;
    width: min(460px, 94%);
    height: min(340px, 50vh);
    min-height: 260px;
    max-width: 100%;
    gap: 0;
    padding: 8px 4px;
    overflow: visible;
    grid-template-columns: none;
    grid-template-rows: none;
  }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--card-w);
    min-width: var(--card-w);
    margin: 0;
    overflow: visible;
    justify-self: auto;
    grid-column: auto;
    grid-row: auto;
  }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-name {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    max-width: none;
    font-size: 10px;
    padding: 2px 7px;
    white-space: nowrap;
    overflow: visible;
    z-index: 3;
  }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-who {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p0,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p0 { transform: translate(-50%, -50%) translateY(120px); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1 { transform: translate(-50%, -50%) translate(118px, 66px) rotate(18deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 { transform: translate(-50%, -50%) translate(118px, -66px) rotate(10deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3 { transform: translate(-50%, -50%) translateY(-120px); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 { transform: translate(-50%, -50%) translate(-118px, -66px) rotate(-10deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5 { transform: translate(-50%, -50%) translate(-118px, 66px) rotate(-18deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5 .trick-name { transform: translateX(-50%) rotate(18deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 .trick-name,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3 .trick-name,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 .trick-name {
    top: auto;
    bottom: calc(100% + 2px);
  }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 .trick-name { transform: translateX(-50%) rotate(-10deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 .trick-name { transform: translateX(-50%) rotate(10deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1 .trick-name { transform: translateX(-50%) rotate(-18deg); }
}
@media (max-width: 639px) {
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6,
  .table-stage:is(.view-kout, .view-bkout) .felt.seats-6 .trick-area.seats-6 {
    height: min(400px, 56vh);
    min-height: 280px;
  }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p0,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p0 { transform: translate(-50%, -50%) translateY(108px); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1 { transform: translate(-50%, -50%) translate(96px, 58px) rotate(22deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 { transform: translate(-50%, -50%) translate(96px, -58px) rotate(12deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3 { transform: translate(-50%, -50%) translateY(-112px); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 { transform: translate(-50%, -50%) translate(-96px, -58px) rotate(-12deg); }
  .page-bkout .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5 { transform: translate(-50%, -50%) translate(-96px, 58px) rotate(-22deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p5 .trick-name { transform: translateX(-50%) rotate(22deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 .trick-name,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p3 .trick-name,
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 .trick-name {
    top: auto;
    bottom: calc(100% + 2px);
  }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p2 .trick-name { transform: translateX(-50%) rotate(-12deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p4 .trick-name { transform: translateX(-50%) rotate(12deg); }
  .table-stage:is(.view-kout, .view-bkout) .trick-area.seats-6 .trick-p1 .trick-name { transform: translateX(-50%) rotate(-22deg); }
  .table-stage:is(.view-kout, .view-bkout) .bk-won { bottom: 36px; }
  .table-stage:is(.view-kout, .view-bkout) .bk-won.team-us { inset-inline-start: 34px; }
  .table-stage:is(.view-kout, .view-bkout) .bk-won.team-them { inset-inline-end: 34px; }
}
.bk-toolbar .btn-icon.auto-on { color: var(--warn); border-color: var(--warn); }

.page-bkout .table-stage .trick-p.team-us .pcard,
.page-bkout .table-stage .trick-p.team-us .trick-slot {
  width: calc(var(--card-w) * 1.1);
  height: calc(var(--card-h) * 1.1);
}
.page-bkout .table-stage .trick-p.team-us { width: auto; min-width: calc(var(--card-w) * 1.1); }
.page-bkout .table-stage .trick-p.team-them { width: auto; min-width: calc(var(--card-w) * 0.84); }
.page-bkout .table-stage .trick-p.team-them .pcard,
.page-bkout .table-stage .trick-p.team-them .trick-slot {
  width: calc(var(--card-w) * 0.84);
  height: calc(var(--card-h) * 0.84);
}
.trick-p:not(.empty) > .pcard {
  transform: rotate(var(--throw, 0deg));
  transform-origin: 50% 55%;
}

.felt-msg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  max-width: min(92%, 440px);
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  padding: 16px 24px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 2px solid var(--accent);
  box-shadow: 0 14px 36px rgba(0,0,0,.38);
  pointer-events: none;
}
.felt.has-kitty .felt-msg {
  top: 16%;
  transform: translate(-50%, 0);
}
.table-msg.top-msg {
  margin: 0;
  font-size: 13px;
  padding: 6px 16px;
  max-width: min(100%, 380px);
}
.ex-style-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 440px);
  margin: 0 auto;
}
.ex-style-actions .btn {
  white-space: normal;
  line-height: 1.35;
  padding: 12px 16px;
  text-align: start;
  font-size: 14px;
}
.ex-style-actions .ex-def {
  display: inline-block;
  margin-inline-start: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--warn);
  vertical-align: middle;
}
.felt-msg .ex-line {
  margin-top: 8px;
  font-size: 0.92em;
  font-weight: 700;
}
@media (min-width: 860px) {
  .felt-msg { font-size: 22px; padding: 22px 32px; }
  .table-msg.top-msg { font-size: 15px; padding: 7px 18px; }
}

.trick-p { position: relative; overflow: visible; }
.win-arm {
  position: absolute;
  top: -8px;
  inset-inline-end: -10px;
  z-index: 8;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 90%, #000);
  color: #1c1406;
  display: grid; place-items: center;
  animation: armPulse 900ms ease-in-out infinite;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 40%, transparent);
  pointer-events: none;
}
.win-arm .ico { width: 16px; height: 16px; stroke-width: 2.2; }
.win-arm.down { background: color-mix(in srgb, #9f1239 88%, #000); color: #fff7ed; box-shadow: 0 0 0 3px color-mix(in srgb, #9f1239 40%, transparent); }
@keyframes armPulse {
  0%, 100% { transform: scale(1) rotate(-8deg); opacity: 1; }
  50% { transform: scale(1.18) rotate(8deg); opacity: 0.85; }
}

.bk-more {
  position: absolute; top: calc(100% - 4px); inset-inline-end: 8px;
  z-index: 60; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 2px;
}
.bk-more button {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; color: inherit;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-align: start;
  min-height: 44px; cursor: pointer;
}
.bk-more button:hover, .bk-more button:active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.bk-more button.danger { color: var(--warn); }

.bk-names-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 0 8px 6px; flex-shrink: 0;
}
.bk-names {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px 6px; border-radius: 10px;
  border: 1px solid var(--border);
  min-height: 32px; align-items: center;
}
.bk-names.team-us { border-color: color-mix(in srgb, var(--team-us) 40%, var(--border)); }
.bk-names.team-them { border-color: color-mix(in srgb, var(--team-them) 40%, var(--border)); }
.bk-names.active { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.bk-names .ts-player { font-size: 11px; padding: 2px 7px; }

.bk-ticker {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px; padding: 0 8px 6px; flex-shrink: 0;
}
.bk-ticker .tk {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 6px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 10px; font-weight: 700; color: var(--muted);
  min-width: 0; overflow: hidden;
}
.bk-ticker .tk b { font-size: 12px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-ticker .tk.on { border-color: var(--accent); color: var(--accent); }
.bk-ticker .tk.team-us { border-color: color-mix(in srgb, var(--team-us) 35%, var(--border)); }
.bk-ticker .tk.team-them { border-color: color-mix(in srgb, var(--team-them) 35%, var(--border)); }
.bk-ticker .tk.bought {
  color: var(--fg);
  font-weight: 800;
}
.bk-ticker .tk.bought.team-us {
  background: color-mix(in srgb, var(--team-us) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--team-us) 75%, var(--border));
}
.bk-ticker .tk.bought.team-them {
  background: color-mix(in srgb, var(--team-them) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--team-them) 75%, var(--border));
}
.bk-ticker .tk.bought b { color: inherit; }
.bk-ticker .tk.high {
  color: #7dd3fc;
  background: color-mix(in srgb, #38bdf8 22%, var(--surface));
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #38bdf8 55%, transparent);
}
.bk-ticker .tk.high b { color: #7dd3fc; font-weight: 800; }
.bk-ticker .tk.taf { opacity: 0.62; }
.bk-ticker.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ts-player.bought:not(.buyer):not(.high-bid) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent);
}
.ts-player.high-bid {
  box-shadow: 0 0 0 2px #38bdf8;
  color: #7dd3fc;
}

.bk-bidbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 16px 8px 8px;
  overflow: visible;
}
.bk-bidbar .btn {
  width: auto;
  min-width: 72px;
  min-height: 44px;
  padding: 8px 18px;
  font-size: 16px;
  position: relative;
  overflow: visible;
  justify-content: center;
}
.bk-bidbar .think-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  right: auto;
  inset-inline-end: auto;
  transform: translateX(-50%);
}
.hint-why { display: none; }
.pcard.hint-glow { outline: 3px solid var(--warn); outline-offset: 2px; }
button.pcard.proj-card { overflow: visible; isolation: auto; }
.pcard.proj-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  overflow: visible;
  isolation: auto;
  z-index: 8;
}
.pcard.proj-g0 {
  outline-color: var(--team-us);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--team-us) 45%, transparent);
}
.pcard.proj-g1 {
  outline-color: var(--success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 45%, transparent);
}
.proj-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
}
.pcard.proj-g0 .proj-badge {
  background: var(--team-us);
  color: var(--accent-fg);
}
.pcard.proj-g1 .proj-badge {
  background: var(--success);
  color: var(--bg);
}
.bk-bidbar .proj-gp {
  font-size: 12px;
  font-weight: 800;
  margin-inline-start: 6px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.hand-row:has(.proj-card) { padding-top: 22px; }

.trick-p.fly-in > .pcard {
  animation: cardFly 220ms var(--ease-out, ease-out);
}
@keyframes cardFly {
  from { transform: translateY(16px) scale(0.86) rotate(calc(var(--throw, 0deg) * 0.4)); opacity: 0.4; }
  to { transform: rotate(var(--throw, 0deg)); opacity: 1; }
}
.tx-lad .pcard.fly-in {
  animation: ladDrop 260ms var(--ease-out, ease-out);
}
@keyframes ladDrop {
  from { transform: translateY(22px) scale(0.82) rotate(-16deg); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}
.hand-row.deal-pop .pcard {
  animation: dealPop 420ms var(--ease-out, ease-out) both;
}
.hand-row.deal-pop .pcard:nth-child(2) { animation-delay: 30ms; }
.hand-row.deal-pop .pcard:nth-child(3) { animation-delay: 60ms; }
.hand-row.deal-pop .pcard:nth-child(4) { animation-delay: 90ms; }
.hand-row.deal-pop .hand-suit:nth-child(2) .pcard { animation-delay: 80ms; }
@keyframes dealPop {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.trick-win {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  z-index: 8; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
  background: var(--surface); border: 1px solid var(--border);
  white-space: nowrap;
}
.trick-win.team-us { color: var(--team-us); border-color: var(--team-us); }
.trick-win.team-them { color: var(--team-them); border-color: var(--team-them); }

.end-card.bk-end { width: min(340px, 92%); }
.end-card.bk-end.bl-end { width: min(400px, 94%); text-align: center; }
.bl-end-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
}
.bl-calc {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 2px 0 10px;
  font-variant-numeric: tabular-nums;
}
.bl-calc th, .bl-calc td {
  padding: 5px 8px;
  line-height: 1.3;
}
.bl-calc thead th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.bl-calc thead th.us, .bl-calc td.us { color: var(--team-us); }
.bl-calc thead th.them, .bl-calc td.them { color: var(--team-them); }
.bl-calc tbody th {
  text-align: start;
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
}
.bl-calc td { text-align: end; font-weight: 800; }
.bl-calc td.z { opacity: 0.45; font-weight: 600; }
.bl-calc tr.dim th, .bl-calc tr.dim td { font-weight: 600; opacity: 0.85; }
.bl-calc tr.sub th {
  border-top: 1px solid var(--border);
  color: var(--fg);
}
.bl-calc tr.sub td { border-top: 1px solid var(--border); }
.bl-calc tr.total th, .bl-calc tr.total td {
  font-size: 15px;
  font-weight: 900;
  color: var(--fg);
  padding-top: 8px;
}
.bl-calc tr.total td.us { color: var(--team-us); }
.bl-calc tr.total td.them { color: var(--team-them); }
.bl-end-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 8px;
  text-align: start;
}
.bl-end-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.bl-detail-btn { display: inline-flex; }
.bl-sheet-mask {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 12, 22, 0.72);
  padding: 16px 20px;
  cursor: pointer;
}
.bl-sheet {
  cursor: default;
  width: min(780px, 96vw);
  max-height: min(86vh, 740px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  padding: 18px 18px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: start;
}
.bl-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bl-sheet-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.bl-sheet-meta {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.bl-sheet-close { flex-shrink: 0; }
.bl-sheet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 20px;
  align-items: start;
}
.bl-tricks h4, .bl-math h4, .bl-sec h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bl-trick {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px 8px;
  margin-bottom: 8px;
  background: color-mix(in srgb, var(--bg-mid) 55%, transparent);
}
.bl-trick.team-us { border-inline-start: 3px solid var(--team-us); }
.bl-trick.team-them { border-inline-start: 3px solid var(--team-them); }
.bl-trick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}
.bl-trick-n { color: var(--fg); }
.bl-trick-win { color: var(--muted); font-weight: 700; }
.bl-trick-pts { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.bl-trick-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  direction: ltr;
}
.bl-play {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.bl-play .pcard, .bl-sheet .pcard.mini {
  width: 44px;
  height: 62px;
  border-radius: 6px;
}
.bl-play.win .pcard, .bl-win-card {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.bl-play figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted);
  max-width: 64px;
  text-align: center;
}
.bl-play-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 64px;
}
.bl-play-pts { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 800; }
.bl-play.team-us .bl-play-who { color: var(--team-us); }
.bl-play.team-them .bl-play-who { color: var(--team-them); }
.bl-trick-run, .bl-trick-extra {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.bl-trick-extra { color: var(--accent); }
.bl-sec { margin-bottom: 14px; }
.bl-muted { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.bl-proj-list { list-style: none; margin: 0 0 8px; padding: 0; }
.bl-proj-list li {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.bl-proj-list li.dropped { opacity: 0.55; font-weight: 600; }
.bl-proj-who { color: var(--fg); }
.bl-rubber {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 800;
}
.bl-taken-pile { margin-bottom: 10px; }
.bl-taken-pile h4 { margin-bottom: 6px; }
@media (min-width: 860px) {
  .bl-sheet-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  }
}
@media (min-width: 860px) and (max-width: 1099px) {
  .bl-sheet-grid { grid-template-columns: 1fr; }
  .bl-sheet { max-height: min(90vh, 680px); }
}
@media (prefers-reduced-motion: reduce) {
  .bl-sheet-mask { animation: none; }
}
@media (max-width: 859px) {
  .end-card.bk-end.bl-end { width: min(360px, 96%); padding: 14px 12px; }
  .bl-end-actions { flex-direction: column; align-items: stretch; }
  .bl-end-actions .btn { width: 100%; justify-content: center; }
  .bl-calc { font-size: 12px; }
  .bl-calc th, .bl-calc td { padding: 4px 6px; }
  .bl-sheet-mask {
    padding: 0;
    place-items: stretch;
  }
  .bl-sheet {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .bl-sheet-head {
    position: sticky;
    top: -12px;
    z-index: 2;
    margin: -12px -14px 12px;
    padding: 12px 14px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .bl-play .pcard, .bl-sheet .pcard.mini {
    width: 40px;
    height: 56px;
  }
}
.bk-end-res { font-size: 16px; font-weight: 800; margin: 8px 0 4px; }
.bk-end-tally { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.bk-end-k { font-size: 13px; color: var(--muted); }
.bk-end-kouts {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 8px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}
.bk-end-kouts .k-us { color: var(--team-us); }
.bk-end-kouts .k-them { color: var(--team-them); }
.bk-end-kouts .k-dot { color: var(--muted); font-size: 0.55em; font-weight: 800; }
.bk-end.won { box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 50%, transparent); }
.bk-end.fell { box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 45%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .trick-p.fly-in > .pcard, .tx-lad .pcard.fly-in, .hand-row.deal-pop .pcard { animation: none; }
}
@media (min-width: 860px) {
  .page-bkout .table-stage .felt.seats-6 { min-height: 0; flex: 1; }
  .page-bkout .table-stage .trick-area.seats-6 {
    display: block;
    position: relative;
    width: min(560px, 90%);
    height: min(520px, 58vh);
    min-height: 420px;
  }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--card-w);
    gap: 6px;
  }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p2,
  .page-bkout .table-stage .trick-area.seats-6 .trick-p3,
  .page-bkout .table-stage .trick-area.seats-6 .trick-p4 { flex-direction: column-reverse; }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p0 { transform: translate(-50%, -50%) translateY(calc(var(--card-h) * 1.32)); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p1 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * 1.78), calc(var(--card-h) * 0.72)) rotate(8deg); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p2 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * 1.78), calc(var(--card-h) * -0.72)) rotate(6deg); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p3 { transform: translate(-50%, -50%) translateY(calc(var(--card-h) * -1.38)); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p4 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * -1.78), calc(var(--card-h) * -0.72)) rotate(-6deg); }
  .page-bkout .table-stage .trick-area.seats-6 .trick-p5 { transform: translate(-50%, -50%) translate(calc(var(--card-w) * -1.78), calc(var(--card-h) * 0.72)) rotate(-8deg); }
  .page-bkout .table-stage .felt.seats-4 { min-height: 0; flex: 1; }
  .page-bkout .table-stage .trick-area.seats-4 {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    position: relative;
    width: min(720px, 78%);
    max-width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 0;
    align-self: center;
    margin-inline: auto;
    gap: 0 16px;
    padding: 10px 8px 14px;
    place-items: unset;
  }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 auto;
    gap: 6px;
    transform: none;
  }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p2 { flex-direction: column-reverse; }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p0 { grid-column: 2; grid-row: 3; align-self: end; justify-self: center; z-index: 3; }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p1 { grid-column: 1; grid-row: 2; justify-self: end; align-self: center; }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p2 { grid-column: 2; grid-row: 1; align-self: start; justify-self: center; z-index: 3; }
  .page-bkout .table-stage .trick-area.seats-4 .trick-p3 { grid-column: 3; grid-row: 2; justify-self: start; align-self: center; }
  .page-bkout .table-stage.view-kout .trick-area.seats-4 .trick-p1 { grid-column: 3; grid-row: 2; justify-self: start; }
  .page-bkout .table-stage.view-kout .trick-area.seats-4 .trick-p3 { grid-column: 1; grid-row: 2; justify-self: end; }
  .page-bkout .table-stage .trick-name {
    font-size: 13px;
    padding: 3px 10px;
    max-width: min(240px, 28vw);
    gap: 5px;
    overflow: visible;
  }
  .page-bkout .table-stage .team-pip { width: 10px; height: 10px; }
  .page-bkout .table-stage .team-pip.them { width: 9px; height: 9px; }
  .page-bkout .table-stage .trick-slot { font-size: 14px; border-radius: 10px; }
  .page-bkout .table-stage .hand-dock {
    max-height: none;
    flex-shrink: 0;
  }
  .page-bkout .table-stage .hand-row {
    justify-content: center;
    padding-block: 16px 8px;
    max-height: calc(var(--card-h) + 44px);
    overflow: visible;
    gap: 8px 10px;
  }
  .page-bkout .table-stage .hand-row .pcard { border-radius: 10px; }
  .page-bkout .table-stage.view-baloot:not(.wide-book) {
    grid-template-columns: minmax(0, 230px) minmax(360px, 1fr) minmax(0, 200px);
  }
  .page-bkout .table-stage.view-baloot .stage-board {
    min-width: 360px;
  }
  .page-bkout .table-stage.view-baloot .hand-dock {
    container-type: inline-size;
  }
  .page-bkout .table-stage.view-baloot .hand-row {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    --hand-gap: 6px;
    --fit-w: min(var(--card-w), calc((100cqi - 7 * var(--hand-gap)) / 8));
    gap: var(--hand-gap);
    overflow: visible;
  }
  .page-bkout .table-stage.view-baloot .hand-row .pcard {
    flex: 0 0 auto;
    width: var(--fit-w);
    height: calc(var(--fit-w) * var(--card-h) / var(--card-w));
    max-width: none;
    min-width: 0;
  }
  .bk-toolbar { padding: 8px 14px; gap: 8px; }
  .bk-scorechip { font-size: 13px; min-height: 38px; padding: 6px 12px; }
  .bk-scorechip b { font-size: 20px; }
  .bk-scorechip.tally span { font-size: 12px; }
  .bk-names-row, .bk-ticker { padding-inline: 14px; gap: 8px; }
  .bk-names { min-height: 40px; padding: 6px 8px; gap: 6px; }
  .bk-names .ts-player { font-size: 14px; padding: 4px 10px; }
  .bk-ticker .tk { font-size: 12px; padding: 6px 8px; }
  .bk-ticker .tk b { font-size: 14px; }
  .bk-ticker.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bk-bidbar .btn { min-width: 88px; min-height: 48px; font-size: 18px; padding: 10px 22px; }
  .think-badge { font-size: 13px; min-width: 2.8em; padding: 4px 8px; top: -14px; }
}
@media (min-width: 1200px) {
  .page-bkout .table-stage .trick-area.seats-6 {
    width: min(620px, 86%);
    height: min(560px, 60vh);
    min-height: 460px;
  }
  .page-bkout .table-stage .trick-area.seats-4 {
    width: min(620px, 84%);
  }
}
@media (min-width: 1500px) {
  .page-bkout .table-stage .trick-area.seats-6 {
    width: min(680px, 78%);
    height: min(600px, 60vh);
  }
  .page-bkout .table-stage .trick-area.seats-4 {
    width: min(680px, 78%);
  }
}

/* Baloot N/S ride the extra felt instead of sitting in a fixed middle cluster */
@media (min-width: 860px) {
  .page-bkout .table-stage.view-baloot .trick-area.seats-4 {
    width: min(760px, 82%);
    align-self: center;
    margin-inline: auto;
    padding: 8px 10px 16px;
  }
}

html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot .trick-area.seats-4,
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  position: relative;
  width: min(640px, 86%);
  max-width: 100%;
  height: auto;
  min-height: 0;
  flex: 1 1 0;
  align-self: center;
  margin-inline: auto;
  gap: 0 10px;
  padding: 6px 6px 10px;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 .trick-p {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  margin: 0 auto;
  transform: none;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 .trick-p0 {
  grid-column: 2; grid-row: 3; align-self: end; transform: none; z-index: 3;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 .trick-p1 {
  grid-column: 1; grid-row: 2; justify-self: end; align-self: center; transform: none;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 .trick-p2 {
  grid-column: 2; grid-row: 1; align-self: start; transform: none; z-index: 3;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 .trick-p3 {
  grid-column: 3; grid-row: 2; justify-self: start; align-self: center; transform: none;
}

/* Must follow the 860px 3-col Baloot hand-fit rule or wide-book's 4th column collapses the felt. */
@media (min-width: 1400px) {
  .page-bkout .table-stage.view-baloot.wide-book {
    grid-template-columns: minmax(0, 220px) minmax(400px, 1fr) minmax(0, 190px) minmax(0, 240px);
    grid-template-areas: "tracker board log book";
  }
  .page-bkout .table-stage.view-baloot.wide-book .stage-board {
    min-width: 400px;
  }
  .page-bkout .table-stage.view-baloot.wide-book .stage-book {
    display: flex;
    grid-area: book;
    grid-column: 4;
    grid-row: 1;
    min-height: 0;
    min-width: 0;
    max-width: 240px;
    height: 100%;
    overflow: auto;
  }
}

/* Tarneeb: compact 4-card plus that does not overlap, smaller felt cards */
.page-bkout .table-stage.view-tarneeb .felt.seats-4 {
  flex: 1 1 auto;
  min-height: 0;
}
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto auto;
  width: max-content;
  max-width: 94%;
  height: auto;
  min-height: 0;
  margin: auto;
  gap: 8px 12px;
  padding: 6px 8px 10px;
  justify-items: center;
  align-items: center;
}
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: auto;
  margin: 0;
  gap: 4px;
}
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p0 { grid-column: 2; grid-row: 3; transform: none; }
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p1 { grid-column: 1; grid-row: 2; transform: none; justify-self: end; }
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p2 { grid-column: 2; grid-row: 1; transform: none; }
.page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p3 { grid-column: 3; grid-row: 2; transform: none; justify-self: start; }
.page-bkout .table-stage.view-tarneeb .trick-area .pcard,
.page-bkout .table-stage.view-tarneeb .trick-area .trick-slot {
  width: calc(var(--card-w) * 0.84);
  height: calc(var(--card-h) * 0.84);
}
@media (min-width: 860px) {
  .page-bkout .table-stage.view-tarneeb .trick-area.seats-4 {
    display: grid;
    position: relative;
    width: max-content;
    height: auto;
    min-height: 0;
    gap: 10px 16px;
  }
  .page-bkout .table-stage.view-tarneeb .trick-area.seats-4 .trick-p {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    transform: none;
  }
}

.bl-bunts-live {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "lab nums nums"
    "track track track"
    "note note note";
  align-items: center;
  gap: 2px 10px;
  margin: 0 8px 6px;
  padding: 6px 10px 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--fg);
}
.bl-bunts-lab {
  grid-area: lab;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.bl-bunts-nums {
  grid-area: nums;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
}
.bl-bunts-nums .us { color: var(--team-us); }
.bl-bunts-nums .them { color: var(--team-them); }
.bl-bunts-nums b { font-size: 16px; font-weight: 900; }
.bl-bunts-nums .of { color: var(--muted); font-weight: 700; font-size: 11px; }
.bl-bunts-track {
  grid-area: track;
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}
.bl-bunts-track i { display: block; height: 100%; }
.bl-bunts-track i.us { background: var(--team-us); }
.bl-bunts-track i.them { background: var(--team-them); margin-inline-start: auto; }
.bl-bunts-note {
  grid-area: note;
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.3;
}
@media (max-width: 639px) {
  .bl-bunts-live { margin: 0 4px 4px; padding: 5px 8px 6px; }
  .bl-bunts-nums b { font-size: 14px; }
}
html[data-layout="tablet-land"] .bl-bunts-live { margin: 0 6px 4px; padding: 4px 8px 5px; }
html[data-layout="tablet-land"] .bl-bunts-note { display: none; }

.gk-coach,
.sg-coach {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 8px 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent), 0 10px 24px rgba(0, 0, 0, 0.28);
  color: var(--fg);
  text-align: start;
  max-width: 100%;
}
.sg-coach-ico {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}
.sg-coach-ico .ico { width: 20px; height: 20px; }
.sg-coach-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1.2;
}
.sg-coach-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--fg);
}
.sg-coach-body {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 640px) {
  .sg-coach { margin: 0 4px 6px; padding: 8px 10px; gap: 8px; }
  .sg-coach-title { font-size: 13px; }
  .sg-coach-body { font-size: 12px; }
}
@media (min-width: 768px) and (min-height: 901px) {
  .gk-coach,
  .sg-coach { padding: 12px 16px; gap: 12px; }
  .sg-coach-kicker { font-size: 12px; }
  .sg-coach-title { font-size: 17px; line-height: 1.4; }
  .sg-coach-body { font-size: 15px; line-height: 1.55; color: var(--fg); font-weight: 600; }
  .sg-coach-ico .ico { width: 24px; height: 24px; }
}

/* Trix/Hand: wide-book is 3 cols (board | log | book). The 4-col kout
   template plus the 860px "board in column 1" rule stuffed the felt into
   the tracker slot and gave the log the board column. */
@media (min-width: 1400px) {
  .table-stage.wide-book:is(.view-trix, .view-hand) {
    grid-template-columns: minmax(420px, 1fr) minmax(180px, 220px) minmax(200px, 240px);
    grid-template-areas: "board log book";
  }
  .table-stage.wide-book:is(.view-trix, .view-hand) .stage-tracker { display: none; }
  .table-stage.wide-book:is(.view-trix, .view-hand) .stage-board {
    grid-area: board; grid-column: 1; grid-row: 1;
    min-width: 420px;
  }
  .table-stage.wide-book:is(.view-trix, .view-hand) .stage-log {
    grid-area: log; grid-column: 2; grid-row: 1;
  }
  .table-stage.wide-book:is(.view-trix, .view-hand) .stage-book {
    display: flex;
    grid-area: book; grid-column: 3; grid-row: 1;
    min-height: 0; min-width: 0; max-width: 240px; height: 100%;
    overflow: auto;
  }
}

/* Tablet landscape: full-width felt, compact chrome */
html[data-layout="tablet-land"] .table-stage,
html[data-layout="tablet-land"] .page-bkout .table-stage,
html[data-layout="tablet-land"] .table-stage:is(.view-trix, .view-hand),
html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot:not(.wide-book),
html[data-layout="tablet-land"] .table-stage.wide-book,
html[data-layout="tablet-land"] .page-bkout .table-stage.wide-book,
html[data-layout="tablet-land"] .table-stage.wide-book:is(.view-trix, .view-hand) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: "board" !important;
  gap: 4px;
  padding: 4px 8px 6px;
}
html[data-layout="tablet-land"] .stage-tracker,
html[data-layout="tablet-land"] .stage-log,
html[data-layout="tablet-land"] .stage-book { display: none !important; }
html[data-layout="tablet-land"] .stage-board {
  grid-area: board !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  height: 100%;
}
html[data-layout="tablet-land"] .table-stage.view-baloot,
html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot,
html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot:not(.wide-book) {
  grid-template-columns: minmax(148px, 186px) minmax(0, 1fr) !important;
  grid-template-areas: "tracker board" !important;
  gap: 8px;
}
html[data-layout="tablet-land"] .table-stage.view-baloot .stage-tracker {
  display: flex !important;
  grid-area: tracker !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}
html[data-layout="tablet-land"] .table-stage.view-baloot .stage-board {
  grid-area: board !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
}
html[data-layout="tablet-land"] .table-stage.view-baloot .card-tracker.grid-kout .mini-card.small,
html[data-layout="tablet-land"] .table-stage.view-baloot .card-tracker.grid-kout .mini-card.honor {
  height: 40px;
  font-size: 12px;
}
html[data-layout="tablet-land"] .table-stage.view-baloot .card-tracker.grid-kout .mini-card.honor { height: 44px; font-size: 13px; }
html[data-layout="tablet-land"] .table-stage.view-baloot .card-tracker.grid-kout .card-tracker-cards { gap: 3px; }
html[data-layout="tablet-land"] .table-stage.view-sabeeta,
html[data-layout="tablet-land"] .table-stage.view-sabeeta.wide-book {
  grid-template-columns: minmax(148px, 186px) minmax(0, 1fr) !important;
  grid-template-areas: "tracker board" !important;
  gap: 8px;
}
html[data-layout="tablet-land"] .table-stage.view-sabeeta .stage-tracker {
  display: flex !important;
  grid-area: tracker !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}
html[data-layout="tablet-land"] .table-stage.view-sabeeta .stage-board {
  grid-area: board !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
}
html[data-layout="tablet-land"] .felt { min-height: 0; flex: 1 1 0; margin: 0 6px 6px; overflow: visible; }
html[data-layout="tablet-land"] .felt.seats-6 { min-height: 0; }
html[data-layout="tablet-land"] .toolbar,
html[data-layout="tablet-land"] .bk-toolbar { padding: 4px 8px; gap: 6px; }
html[data-layout="tablet-land"] .bk-scorechip { padding: 4px 8px; font-size: 12px; }
html[data-layout="tablet-land"] .status-bar { gap: 4px; padding: 2px 6px 4px; }
html[data-layout="tablet-land"] .player-status { padding: 4px 6px 5px; }
html[data-layout="tablet-land"] .ps-board.solo .ps-num { font-size: clamp(18px, 3.2vw, 26px); }
html[data-layout="tablet-land"] .team-status { padding: 4px 8px 6px; }
html[data-layout="tablet-land"] .ts-names { margin-top: 4px; }
html[data-layout="tablet-land"] .info-bar { padding: 2px 8px; }
html[data-layout="tablet-land"] .hand-dock {
  max-height: 28vh !important;
  padding: 2px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
html[data-layout="tablet-land"] .page-bkout .table-stage .hand-dock,
html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot .hand-dock { max-height: 28vh !important; }
html[data-layout="tablet-land"] .hand-row,
html[data-layout="tablet-land"] .page-bkout .table-stage .hand-row,
html[data-layout="tablet-land"] .page-bkout .table-stage.view-baloot .hand-row {
  flex-wrap: nowrap;
  justify-content: center;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  padding-block: 12px 4px;
  gap: 4px;
}
html[data-layout="tablet-land"] .gk-coach,
html[data-layout="tablet-land"] .sg-coach {
  margin: 0 6px 4px;
  padding: 6px 10px;
  gap: 8px;
  border-radius: 10px;
}
html[data-layout="tablet-land"] .sg-coach-kicker { font-size: 10px; }
html[data-layout="tablet-land"] .sg-coach-title { font-size: 13px; line-height: 1.3; }
html[data-layout="tablet-land"] .sg-coach-body {
  font-size: 12px;
  line-height: 1.35;
  max-height: 2.7em;
  overflow: hidden;
  font-weight: 650;
  color: var(--muted);
}
html[data-layout="tablet-land"] .sg-coach-ico .ico { width: 18px; height: 18px; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  gap: 8px 10px;
  padding: 6px 4px 8px;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  margin: 0 auto;
  transform: none;
  justify-self: center;
}
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p0 { grid-column: 2; grid-row: 2; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p1 { grid-column: 3; grid-row: 2; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p2 { grid-column: 3; grid-row: 1; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p3 { grid-column: 2; grid-row: 1; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p4 { grid-column: 1; grid-row: 1; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-6 .trick-p5 { grid-column: 1; grid-row: 2; }
html[data-layout="tablet-land"] .page-bkout .table-stage .trick-area.seats-4 {
  min-height: 0;
  height: auto;
}
html[data-layout="tablet-land"] .table-stage.view-hand .status-bar {
  gap: 4px;
  padding: 3px 6px;
}
html[data-layout="tablet-land"] .table-stage.view-hand .player-status { padding: 4px 6px; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-head { margin-bottom: 0; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-name { font-size: 12px; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-lab { display: none; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-board {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
html[data-layout="tablet-land"] .table-stage.view-hand .ps-metric { min-height: 0; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-num { font-size: 13px; padding: 1px 5px; }
html[data-layout="tablet-land"] .table-stage.view-hand .ps-metric.score .ps-num { font-size: 15px; }
html[data-layout="tablet-land"] .cut-card { animation-duration: 0.16s; }





