/* Roomful Cards, phase 4's games (Blackjack, Draw Poker, Texas Hold'em, Solitaire): the middle of the table for each,
   in the same colors and card art as cards.css. Portrait first; the TV (.ct-tv) gets bigger cards from --card-w. */

/* shared by the chip games (cards-chips.js) */
.cc-table, .bj-table { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 100%; }
.cc-pot { margin: 0; padding: 4px 16px; border-radius: 999px; background: var(--rf-night); border: 0; font-weight: 800; font-size: 1.05em; }
.cc-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 2px 4px; }
.cc-actions:empty { display: none; }
.cc-actions .rf-btn { min-height: 44px; }
.cc-mini-row { display: inline-flex; gap: 3px; vertical-align: middle; }
.cc-mini { display: inline-block; width: calc(var(--card-w) * 0.52); height: calc(var(--card-w) * 0.52 * 1.4); border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.cc-mini svg { width: 100%; height: 100%; display: block; }
.ct-dialog .cc-mini { width: 40px; height: 56px; }
.cc-notice { margin: 10px 0 0; font-size: 0.82em; color: var(--paper-dim); }
.cc-showdown { display: grid; gap: 8px; margin: 10px 0; }
/* wider screens: the showdown's hands side by side, so a laptop shows every hand at once */
@media (min-width: 760px) {
  .ct-dialog.handover:has(.cc-showdown) { max-width: 760px; }
  .cc-showdown { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}
.cc-shown { padding: 6px 8px; border-radius: 12px; border: 1px solid rgba(255, 246, 229, 0.18); }
.cc-shown.won { background: rgba(255, 210, 63, 0.12); border-color: var(--accent); }
.cc-shown p { margin: 0 0 4px; }
.cc-shown-name { font-weight: 800; }
.cc-board-line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cc-amount { font-size: 1.6em; font-weight: 800; color: var(--accent); }
.ct-dialog input[type="range"] { width: 100%; min-height: 44px; }

/* Blackjack */
.bj-dealer { min-height: calc(var(--card-w) * 0.52 * 1.4); }
.bj-dealer .cc-mini, .bj-hand .cc-mini { width: calc(var(--card-w) * 0.62); height: calc(var(--card-w) * 0.62 * 1.4); }
.bj-total { margin: 0; font-weight: 750; color: var(--paper-dim); font-size: 0.9em; }
.bj-hands { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
.bj-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bj-name { margin: 0; font-weight: 800; font-size: 0.9em; }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 6px; border-radius: 12px; border: 2px solid transparent; }
.bj-hand.active { border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 210, 63, 0.4); }
.bj-hand.win .bj-total, .bj-hand.blackjack .bj-total { color: var(--accent); }
.bj-hand.lose .cc-mini { opacity: 0.6; } /* a lost hand: its cards dim, its words stay readable (phase 6: 0.7 on the whole hand was 3.2 : 1) */
.bj-betting { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bj-chips { display: flex; gap: 12px; }
.bj-chip { width: 56px; height: 56px; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, 0.85); font-weight: 900; font-size: 1.05em; color: #fff; cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }
.bj-chip.c5 { background: #c0392b; }
.bj-chip.c25 { background: #1e7d4f; }
.bj-chip.c100 { background: #1b1b1b; }
.bj-chip:disabled { opacity: 0.35; cursor: default; }
.bj-bet-line { margin: 0; font-size: 0.85em; color: var(--paper-dim); text-align: center; }

/* Texas Hold'em */
.th-board { display: flex; gap: 6px; justify-content: center; }
.th-slot { display: inline-block; width: calc(var(--card-w) * 0.6); height: calc(var(--card-w) * 0.6 * 1.4); border-radius: 7px; border: 2px dashed rgba(255, 246, 229, 0.25); }
.th-slot.filled { border: 0; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.th-slot svg { width: 100%; height: 100%; display: block; }
.th-shown { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.th-shown:empty { display: none; }
.th-up { display: flex; align-items: center; gap: 6px; }
.th-up-name { font-weight: 750; font-size: 0.85em; }

/* Solitaire: seven columns across the width */
.sol-board { --sol-w: min(calc((100vw - 44px) / 7), calc(var(--card-w) * 0.95)); --sol-h: calc(var(--sol-w) * 1.4); width: calc(var(--sol-w) * 7 + 24px);
  max-width: 100%; display: flex; flex-direction: column; gap: 10px; align-self: center; }
.ct-center:has(.sol-board) { justify-content: flex-start; overflow-y: auto; }
.ct-center:has(.sol-board) > :first-child { margin-top: 0; } /* Solitaire's board starts at the top */
.sol-top, .sol-cols { display: grid; grid-template-columns: repeat(7, var(--sol-w)); gap: 4px; }
.sol-slot, .sol-card { position: relative; width: var(--sol-w); height: var(--sol-h); padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.sol-slot svg, .sol-card svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.sol-empty, .sol-empty-col, .sol-found:not(:has(svg)) { display: grid; place-items: center; border: 2px dashed rgba(255, 246, 229, 0.3); border-radius: 6px; color: var(--paper-dim);
  font-weight: 800; font-size: 1.1em; background: rgba(255, 255, 255, 0.04); }
.sol-empty.red { color: #ffd0d0; } /* a light red: the card red was 1.0-2.8 : 1 on the table (phase 6); this is 3.9 : 1 or more in every color scheme */
.sol-found .sol-empty { border: 0; background: none; }
.sol-slot:disabled, .sol-card:disabled { cursor: default; }
.sol-count { position: absolute; right: -4px; bottom: -6px; z-index: 3; min-width: 22px; padding: 1px 5px; border-radius: 999px; background: var(--accent); color: var(--ink);
  font-size: 0.7em; font-weight: 800; }
.sol-col { position: relative; width: var(--sol-w); }
.sol-col .sol-card { position: absolute; left: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.sol-card.down { cursor: default; }
.sol-sel { outline: 3px solid var(--accent); outline-offset: -1px; box-shadow: 0 0 12px rgba(255, 210, 63, 0.6); }
.sol-gap { display: block; }

.ct-tv .cc-mini { width: calc(var(--card-w) * 0.45); height: calc(var(--card-w) * 0.45 * 1.4); }
.ct-tv .th-slot { width: calc(var(--card-w) * 0.75); height: calc(var(--card-w) * 0.75 * 1.4); }

/* small phones: a chip game's middle is tall (Hold'em: the board, the pot and up to six buttons), so it tightens up to fit
   above your cards (phase 6: on a 360 x 740 phone Hold'em's buttons and "Your turn" ran off the bottom) */
@media (max-width: 430px), (max-height: 760px) {
  .ct:not(.ct-tv) .cc-table { gap: 4px; }
  .ct:not(.ct-tv) .cc-actions { gap: 6px; }
  .ct:not(.ct-tv) .cc-actions .rf-btn { min-height: 44px; padding: 0 0.85em; font-size: 0.95em; }
  .ct:not(.ct-tv) .th-slot { width: calc(var(--card-w) * 0.5); height: calc(var(--card-w) * 0.5 * 1.4); }
}
