/* Pai Gow Poker. Classes use the pg- prefix. Felt, chips and cards come from /demos/_tables/ (tb-, pc-). */
.pg-screen { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.pg-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pg-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.pg-table { --rail: 20px; height: 580px; }
.pg-felt { --cw: 72px; display: flex; flex-direction: column; align-items: center; padding: 0 18px 18px; }
.pg-tray { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; }
.pg-discard { position: absolute; left: 18px; top: 12px; z-index: 2; }
.pg-shoe { position: absolute; right: 16px; top: 8px; z-index: 2; }
.pg-shoe .tb-shoe-body { transform: scale(.9); transform-origin: 50% 0; }
.pg-shoe.refill .tb-shoe-body { animation: pgrefill .8s cubic-bezier(.2,.8,.3,1.2); }
@keyframes pgrefill { 0% { transform: scale(.9) translateY(-26px); opacity: 0; } 100% { transform: scale(.9); opacity: 1; } }

/* banker */
.pg-banker { position: relative; z-index: 3; margin-top: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; --cw: 58px; }
.pg-who { font: 800 11px Inter, sans-serif; letter-spacing: .24em; text-transform: uppercase; color: rgba(225,235,255,.75); }
.pg-who small { font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: none; color: rgba(225,235,255,.45); margin-left: 6px; }
.pg-bank-row { display: flex; align-items: flex-end; gap: 18px; min-height: calc(var(--cw) * 1.4 + 22px); }
.pg-bank-row.dealt { gap: 0; }
.pg-bank-row.dealt .pc + .pc { margin-left: calc(var(--cw) * -.5); }
.pg-bgrp { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pg-bgrp-c { display: flex; gap: 4px; }
.pg-bgrp-n { font: 600 10.5px 'IBM Plex Mono', monospace; color: rgba(255,255,255,.75); white-space: nowrap; }
.pg-bgrp-n i { font-style: normal; color: rgba(255,255,255,.45); margin-right: 5px; text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; }
.pg-bank-why { max-width: 620px; min-height: 16px; text-align: center; font-size: 11.5px; line-height: 1.4; color: rgba(225,235,255,.62); }
.pg-bank-why b { color: #fff; font-weight: 600; }

.pg-arc { position: absolute; left: 0; right: 0; top: 236px; height: 56px; pointer-events: none; z-index: 1; }
.pg-arc svg { left: 0; top: 0; width: 100%; height: 100%; }

/* foul check line */
.pg-check { position: relative; z-index: 3; margin-top: auto; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.pg-check-idle { font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .06em; color: rgba(255,255,255,.45); }
.pg-chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(5,10,20,.66); border: 1px solid rgba(255,255,255,.14); font-size: 12.5px; color: rgba(255,255,255,.88); animation: pgin .35s cubic-bezier(.2,.9,.3,1.2); max-width: 100%; }
.pg-chip i { font-style: normal; flex: none; font: 800 9.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.pg-chip.ok i { background: var(--tb-win); color: #06281a; }
.pg-chip.foul { border-color: rgba(255,90,110,.6); }
.pg-chip.foul i { background: var(--tb-lose); color: #fff; }
.pg-chip.wait i { background: rgba(255,255,255,.16); color: #fff; }
.pg-chip.res i { background: var(--you); color: var(--you-ink); }
@keyframes pgin { from { opacity: 0; transform: translateY(5px); } }
.pg-check.shake { animation: tbshake .38s; }

/* player */
.pg-player { position: relative; z-index: 3; margin-top: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 14px; width: 100%; }
.pg-spot { --spot: 78px; align-self: center; }
.pg-zone { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-radius: 14px; border: 2px solid rgba(232,214,160,.35); background: rgba(0,0,0,.1); transition: border-color .2s, background .2s, box-shadow .2s; }
.pg-zone.low { border-style: dashed; }
.pg-zone-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pg-zone-h b { font: 800 10.5px Inter, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--tb-ink); }
.pg-zone-h span { font: 600 10.5px 'IBM Plex Mono', monospace; color: rgba(255,255,255,.7); white-space: nowrap; }
.pg-zone-c { display: flex; gap: 6px; min-height: calc(var(--cw) * 1.4); }
.pg-zone.over { border-color: var(--you); background: rgba(255,178,30,.08); }
.pg-zone.good { border-color: rgba(53,227,154,.7); }
.pg-zone.bad { border-color: rgba(255,90,110,.8); box-shadow: 0 0 0 3px rgba(255,90,110,.18); }
.pg-zone.win { border-color: var(--tb-win); box-shadow: 0 0 0 3px rgba(53,227,154,.25); }
.pg-zone.lose { border-color: rgba(255,90,110,.7); }
.pg-zone.copy { border-color: #e6e9ef; }
.pg-zone .res { position: absolute; top: -11px; right: 10px; padding: 2px 8px; border-radius: 6px; font: 800 9.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.pg-zone.win .res { background: var(--tb-win); color: #06281a; }
.pg-zone.lose .res { background: var(--tb-lose); color: #fff; }
.pg-zone.copy .res { background: #e6e9ef; color: #1a1d24; }
.pg-zone-c .pc { cursor: pointer; touch-action: none; transition: transform .15s; }
.pg-zone-c .pc:hover { transform: translateY(-4px); }
.pg-zone-c .pc.drag { z-index: 30; cursor: grabbing; transition: none; }
.pg-zone-c .pc .pg-k { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font: 600 9.5px 'IBM Plex Mono', monospace; color: rgba(255,255,255,.4); }
.pg-felt.locked .pg-zone-c .pc { cursor: default; }
.pg-felt.locked .pg-zone-c .pc:hover { transform: none; }
.pg-felt.locked .pg-k { display: none; }

/* joker */
.pc-front.pg-joker { background: radial-gradient(circle at 50% 45%, #fffaf0, #f3ead6); color: #5b2a86; }
.pg-jk-i { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pg-jk-i.tl { left: 4%; top: 4.5%; } .pg-jk-i.br { right: 4%; bottom: 4.5%; transform: rotate(180deg); }
.pg-jk-i b { font: 900 .62em/1 Inter, sans-serif; letter-spacing: -.02em; writing-mode: vertical-rl; text-orientation: upright; }
.pg-jk-i svg { width: .7em; height: .7em; fill: #c8233a; margin-bottom: .12em; }
.pg-jk-c { position: absolute; inset: 18% 20%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; border-radius: .3em; border: 1.5px solid currentColor; box-shadow: inset 0 0 0 2px #fbf6ea, inset 0 0 0 2.6px currentColor; }
.pg-jk-c svg { width: 1.9em; height: 1.9em; fill: #d99a12; stroke: #5b2a86; stroke-width: 3; }
.pg-jk-c span { font: 900 .5em Inter, sans-serif; letter-spacing: .22em; text-transform: uppercase; margin-right: -.22em; }

/* controls */
.pg-ctrl { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: var(--s-panel); border: 1px solid var(--s-line); }
.pg-bal .tb-balance { padding: 0; border: 0; background: none; gap: 9px; }
.pg-bal .tb-balance-v { font-size: 19px; }
.pg-rack .tb-rchip { --chip: 44px; }
.pg-rack .tb-rack { gap: 8px; }
.pg-ctrl-btns { display: flex; gap: 8px; flex: 1; justify-content: flex-end; align-items: center; }
.pg-hw { min-width: 0; height: 44px; }
.pg-go { min-width: 150px; }

/* side */
.pg-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pg-h small { font-size: 10.5px; color: var(--s-faint); }
.pg-rules ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pg-rules li { font-size: 11.5px; line-height: 1.4; color: var(--s-dim); padding-left: 12px; position: relative; }
.pg-rules li::before { content: ''; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 1px; background: var(--you); }
.pg-rules li b { color: var(--s-text); font-weight: 600; }
.pg-recent { padding: 10px 13px; }
.pg-recent .tb-hist-row { padding: 5px 0; }
.tb-paycard .tb-pay small { font: 600 10px 'IBM Plex Mono', monospace; color: var(--s-faint); margin-left: 6px; }
.pg-note { margin-top: 7px; font-size: 11px; line-height: 1.4; color: var(--s-dim); }
.pg-note b { color: var(--you); font-weight: 600; }

@media (max-width: 1100px) {
  .pg-screen { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .pg-table { height: auto; }
  .pg-felt { --cw: 37px; padding: 0 6px 12px; }
  .pg-zone { padding: 6px 6px 8px; }
  .pg-tray, .pg-arc, .pg-discard { display: none; }
  .pg-shoe .tb-shoe-body { transform: scale(.6); }
  .pg-shoe .tb-shoe-n { position: absolute; right: 52px; top: 10px; }
  .pg-banker { --cw: 34px; margin-top: 46px; }
  .pg-bank-row { gap: 10px; }
  .pg-bank-why { font-size: 10.5px; }
  .pg-check { margin-top: 12px; }
  .pg-chip { font-size: 11px; border-radius: 12px; }
  .pg-player { flex-wrap: wrap; gap: 8px; }
  .pg-zone.high { order: 1; width: 100%; }
  .pg-zone.low { order: 2; }
  .pg-spot { order: 3; --spot: 64px; }
  .pg-zone-c { gap: 3px; }
  .pg-zone.high .pg-zone-c { justify-content: center; }
  .pg-ctrl { flex-wrap: wrap; }
  .pg-rack { order: 3; width: 100%; display: flex; justify-content: center; }
  .pg-ctrl-btns { order: 4; justify-content: center; width: 100%; }
  .pg-go { order: 2; margin-left: auto; min-width: 120px; }
}
