/* The table, as the iPhone app draws it. Linked after site.css on the tool pages and after the landing's own styles.

   The felt is the app's own paint: tools/board-assets/export.sh renders FeltCloth (FeltPaint.swift) to
   the felt-light and felt-dark webp files in /img/board/, a transparent 9-slice holding the lamp, the vignette, the
   shadow under the rail, the leather rail with its bevel and shine, and the inner line. The base gradient and the
   two cloth tiles are drawn here from the same numbers (FeltPaint.swift under(), FeltTiles.swift).
   Cards, plates, tags, the dealer button and the odds badge are the app's values (CardFace.swift, Ring.swift,
   PlayView.swift SeatPlate and dealerButton), ported one for one. */

:root {
  --felt-img: url(/img/board/felt-light.e00ebbae.webp);
  --plate: #122b20;
  --plate-dim: #1c3a2b;
  --plate-inset: #0c2016;
  --lift-near: rgba(0, 0, 0, .03);
  --lift-far: rgba(0, 0, 0, .10);
  --hair: rgba(0, 0, 0, .10);
  --edge-top: rgba(255, 255, 255, .8);
  --edge-bottom: rgba(0, 0, 0, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --felt-img: url(/img/board/felt-dark.8f813abd.webp);
    --plate: #0b1a13;
    --plate-dim: #122419;
    --plate-inset: #07120c;
    --lift-near: rgba(0, 0, 0, .5);
    --lift-far: rgba(0, 0, 0, .8);
    --hair: rgba(255, 255, 255, .12);
    --edge-top: rgba(255, 255, 255, .14);
    --edge-bottom: rgba(0, 0, 0, .6);
  }
}

/* ── cards: the ring and the lift they wear on the felt (Ring.swift, CardView.swift) ──
   A hairline all round, then a 1pt line inside it lit from the top and shaded at the bottom (GradientEdge). */
.pc, .example-cards .pc, .cards.five .pc, .sc .pc, .cards.mini .pc, .eqrows .cards.table .pc {
  box-shadow: inset 0 0 0 1px var(--hair), 0 1px 1.5px var(--lift-near), 0 4px 10px -1px var(--lift-far);
}
.pc::before {
  content: ""; position: absolute; inset: 1px; z-index: 1; padding: 1px; pointer-events: none;
  border-radius: calc(var(--w) * .19 - 1px);
  background: linear-gradient(to bottom, var(--edge-top) 0, transparent 18%, transparent 82%, var(--edge-bottom) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* the back never changes with the phone's theme (CardView.backFace): a field, an inset panel, the spade mark */
.pc.back { background: #efefef; box-shadow: var(--ring), 0 1px 1.5px var(--lift-near), 0 4px 10px -1px var(--lift-far); }
.pc.back::before { inset: calc(var(--w) * .09); padding: 0; border-radius: calc(var(--w) * .11); background: #e9e9e9; -webkit-mask: none; mask: none; z-index: 0; }
.pc.back::after {
  inset: auto; left: 50%; top: 50%; width: calc(var(--w) * .3); height: calc(var(--w) * .42); transform: translate(-50%, -50%);
  border-radius: calc(var(--w) * .045); box-shadow: none; opacity: .9;
  background: #efefef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e9e9e9' d='M12 2.1c-1.9 3.25-4.5 5.15-6.2 7.05a4.95 4.95 0 0 0 3.6 8.1c.85 0 1.63-.22 2.3-.6-.25 2.1-1.2 3.86-2.5 4.7h5.6c-1.3-.84-2.25-2.6-2.5-4.7.67.38 1.45.6 2.3.6a4.95 4.95 0 0 0 3.6-8.1c-1.7-1.9-4.3-3.8-6.2-7.05Z'/%3E%3C/svg%3E") center / 62% no-repeat;
}
@media (prefers-color-scheme: dark) {
  .pc.back { background: #e8e8ec; }
  .pc.back::before { background: #dedee2; }
  .pc.back::after { background-color: #e8e8ec; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23dedee2' d='M12 2.1c-1.9 3.25-4.5 5.15-6.2 7.05a4.95 4.95 0 0 0 3.6 8.1c.85 0 1.63-.22 2.3-.6-.25 2.1-1.2 3.86-2.5 4.7h5.6c-1.3-.84-2.25-2.6-2.5-4.7.67.38 1.45.6 2.3.6a4.95 4.95 0 0 0 3.6-8.1c-1.7-1.9-4.3-3.8-6.2-7.05Z'/%3E%3C/svg%3E"); }
}

/* ── the felt ──
   --end is the gradient's reach: the table's height in the app, 320 at least. */
.table, .cardpick, .cards.five, .tp {
  --end: 320px;
  --pad: 28px;
  position: relative;
  isolation: isolate;
  border-radius: 38px;
  background:
    url(/img/board/felt-fibre.4f32106e.webp) 0 0 / 57.6px 57.6px,
    url(/img/board/felt-weave.ca396a5d.png) 0 0 / 4px 4px,
    radial-gradient(circle var(--end) at 50% 35%, var(--felt-hi) 20px, var(--felt) calc(10px + var(--end) / 2), var(--felt-lo) var(--end));
  box-shadow: none;
  color: var(--on-felt);
}
.table::before, .cardpick::before, .cards.five::before, .tp::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border: 40px solid transparent; border-radius: 38px;
  border-image: var(--felt-img) 120 fill / 40px stretch;
}
.cardpick { padding: 34px 28px 32px; }
.cards.five { padding: var(--pad); justify-content: center; flex-wrap: nowrap; gap: 6px; margin: 6px 0 14px; }
.cards.five .pc { --w: clamp(34px, calc((100vw - 150px) / 5.4), 56px); }
.cards.five .ghostcard { width: clamp(34px, calc((100vw - 150px) / 5.4), 56px); --w: clamp(34px, calc((100vw - 150px) / 5.4), 56px); }
.example-cards { padding: var(--pad); justify-content: center; }
.dealtable { padding: var(--pad) 24px; gap: 20px; }
.dealtable.idle { padding: 34px 24px; }

/* an empty place for a card: the app draws only the hairline, at the card's radius (PlayView, the empty slot) */
.sc.empty, .cslot:not(.has), .ghostcard { border: 1px solid var(--felt-line); border-radius: calc(var(--w, 52px) * .19); background: none; }
.sc.empty { --w: 62px; }
.cslot:not(.has) { color: var(--on-felt-3); }
.cslot:not(.has):hover { border-color: var(--on-felt-2); color: var(--on-felt-2); }
.cslot.has { box-shadow: none; }

/* ── seats ── */
.boardrow { gap: 8px; padding-top: 4px; }
.seats { gap: 30px 14px; justify-items: center; align-items: start; padding-bottom: 4px; }
.seat { --cw: 40px; position: relative; display: grid; justify-items: center; align-content: start; gap: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; width: 100%; }
.seat.winner { box-shadow: none; }
.seat-cards { display: flex; justify-content: center; gap: 3px; max-width: none; margin-bottom: -8px; position: relative; z-index: 0; }
.seat-cards .sc { width: var(--cw); flex: none; }
.seat-cards .sc:nth-child(odd) { transform: rotate(-1.5deg); }
.seat-cards .sc:nth-child(even) { transform: rotate(1.5deg); }
.seats[data-hole="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seat[data-hole="4"] { --cw: clamp(20px, calc((100vw - 190px) / 7.3), 36px); }
@media (min-width: 600px) { .seats[data-hole="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } .seat[data-hole="4"] { --cw: 36px; } }
.seat[data-hole="5"] { --cw: 32px; }

/* the plate: a capsule of solid paint with the name and a figure, a tag on its shoulder (SeatPlate) */
.plate { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 90px; max-width: 100%; min-height: 29px; padding: 2px 10px; border-radius: 9999px; background: var(--plate); color: var(--on-felt); }
.plate-name { font: 600 11px/1.2 var(--font-text); color: var(--on-felt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-fig { font: 600 12px/1.2 var(--font-display); color: var(--on-felt); font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.plate-tag { position: absolute; right: -4px; bottom: calc(100% - 6px); display: inline-flex; align-items: center; min-height: 17px; padding: 0 5px; border-radius: 9999px; background: var(--plate-inset); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); font: 700 11px/1 var(--font-text); letter-spacing: .3px; color: var(--on-felt); white-space: nowrap; }
/* the odds badge: ink on the felt, hung under the plate */
.odds { position: relative; z-index: 2; margin-top: -4px; display: inline-flex; padding: 2px 8px; border-radius: 9999px; background: var(--ink); color: var(--surface); font: 700 12px/1.3 var(--font-display); letter-spacing: .2px; font-variant-numeric: tabular-nums; box-shadow: 0 2px 4px rgba(0, 0, 0, .22); }
.seat-eq { color: var(--on-felt-2); font-size: 12px; line-height: 1.3; }
.seat .seat-eq { margin-top: 6px; justify-content: center; text-align: center; display: grid; justify-items: center; gap: 4px; }
.seat .seat-eq.wait .odds { opacity: .55; }

/* the dealer's button: a disc in the page's own black or white with a spade, and a D (dealerButton) */
.dealer { position: absolute; z-index: 3; left: -34px; bottom: -2px; width: 26px; height: 26px; }
.dealer .disc { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); box-shadow: var(--ring-strong); }
.dealer .disc svg { width: 14px; height: 14px; fill: var(--ink); }
.dealer .d { position: absolute; right: -3px; top: -3px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); box-shadow: var(--ring-strong); font: 700 11px/1 var(--font-display); color: var(--ink); }

/* the equity calculator's hands, seated, under the board if there is one */
.eqtable { display: grid; gap: 22px; padding: var(--pad) 22px 30px; margin: 4px 0 14px; }
.eqtable .seats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 26px; }
.eqtable .seat { width: auto; }
.eqtable .seat-eq { white-space: nowrap; }
.eqtable .seat-cards .pc { --w: 44px; }
.eqtable .seat-cards .pc:nth-child(odd) { transform: rotate(-1.5deg); }
.eqtable .seat-cards .pc:nth-child(even) { transform: rotate(1.5deg); }
.eqtable .boardrow { display: flex; justify-content: center; gap: 6px; padding: 0; }
.eqtable .boardrow .pc { --w: clamp(34px, calc((100vw - 170px) / 5.4), 52px); }

/* a row of loose cards on a felt (the quiz board, the pot odds example) shrinks with the screen instead of running off it */
.table .qgroup .cards, .example-cards { gap: 6px; flex-wrap: nowrap; }
.table .qgroup .pc, .example-cards .pc { --w: clamp(30px, calc((100vw - 150px) / 6.2), 52px); }
