/* Baccarat: table, cards and squeeze, roadmaps, seats, betting board and panels.
   Loaded after style.css on the /baccarat/ pages. The controls shared with the
   blackjack table (settings bar, chips, panels, switches) are repeated here so the
   two games can change independently. */

/* ---------- intro ---------- */

.intro {
  padding: 18px 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px 28px;
}

.intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.2;
  color: var(--ivory);
}

.intro-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- game bar ---------- */

.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 24px;
  margin-bottom: 12px;
}

.bank {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.bank-label {
  font-size: 13px;
  color: var(--muted);
}

.bank-value {
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

.text-btn {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover:not(:disabled) {
  color: var(--brass-hi);
}

.text-btn[data-armed="1"] {
  color: var(--warn);
}

.text-btn:disabled {
  opacity: 0.4;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}

.set {
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-label {
  font-size: 12px;
  color: var(--muted);
}

.seg,
.stepper {
  display: inline-flex;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}

.seg button,
.stepper button {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: none;
  font-size: 13px;
}

.seg button + button {
  border-left: 1px solid rgba(212, 175, 106, 0.25);
}

.seg button[aria-pressed="true"] {
  background: var(--brass);
  color: var(--room-deep);
  font-weight: 700;
}

.stepper output {
  min-width: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  border-left: 1px solid rgba(212, 175, 106, 0.25);
  border-right: 1px solid rgba(212, 175, 106, 0.25);
}

.stepper button:disabled,
.seg button:disabled {
  opacity: 0.45;
}

.select {
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23D4AF6A'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
}

.select option {
  background: var(--room-deep);
}

.select:disabled {
  opacity: 0.45;
}

/* ---------- table ---------- */

.table-wrap {
  position: relative;
  width: 100%;
  max-width: max(940px, calc((100vh - 430px) * 2.15 + 32px));
  margin: 0 auto;
}

.table-rim {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 34px 34px 50% 50% / 34px 34px 78% 78%;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(180deg, #3a2219, #1c0e09 60%, #0d0604);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6);
}

.table-rim::before {
  /* thin brass edge between rail and felt */
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 30px 30px 50% 50% / 30px 30px 78% 78%;
  border: 1px solid rgba(212, 175, 106, 0.45);
  pointer-events: none;
}


.felt-msg {
  position: absolute;
  top: calc(4% + var(--ch) + 46px);
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  max-width: min(78%, 560px);
  margin: 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(6, 26, 23, 0.72);
  border: 1px solid rgba(212, 175, 106, 0.35);
  color: var(--ivory);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.felt-msg:empty {
  display: none;
}

.felt-msg[data-tone="good"] {
  color: var(--good);
  border-color: rgba(127, 211, 168, 0.5);
}

.felt-msg[data-tone="bad"] {
  color: var(--bad);
  border-color: rgba(255, 138, 143, 0.5);
}

.felt-msg[data-tone="warn"] {
  color: var(--warn);
  border-color: rgba(255, 210, 122, 0.55);
}

.felt-msg.pop {
  animation: pop 0.25s ease-out;
}

@keyframes pop {
  from { opacity: 0.4; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}


.chips {
  display: flex;
  gap: 8px;
}

.chip {
  --chip: #2463b4;
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--chip) 0 54%, transparent 55%),
    repeating-conic-gradient(var(--chip) 0 30deg, #f4ebd6 30deg 45deg);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 6px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s;
}

.chip span {
  position: absolute;
  inset: 22%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.6);
  font-family: "Bodoni Moda", serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.chip:hover:not(:disabled) {
  transform: translateY(-3px);
}

.chip:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}

.chip:disabled {
  opacity: 0.35;
  filter: saturate(0.4);
}

.c10 { --chip: #2463b4; --chip-side: #173f73; }

.c25 { --chip: #2e8b57; --chip-side: #1b5636; }

.c100 { --chip: #2a2a2e; --chip-side: #0c0c0e; }

.c500 { --chip: #6b3fa0; --chip-side: #3f235f; }

.c1000 { --chip: #d98f20; --chip-side: #8a5a12; }

.c1000 span,
.c100 span {
  color: #fff;
}

/* ---------- study panels ---------- */

.study {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid rgba(212, 175, 106, 0.38);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 8, 10, 0.88), rgba(14, 5, 7, 0.92));
  overflow: hidden;
}

.panel > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.panel > summary::-webkit-details-marker {
  display: none;
}

.panel > summary::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--brass);
  border-bottom: 2px solid var(--brass);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.panel[open] > summary::before {
  transform: rotate(45deg);
}

.p-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--brass-hi);
}

.p-toggle {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 999px;
  padding: 1px 10px;
}

.panel .when-open,
.panel[open] .when-closed {
  display: none;
}

.panel[open] .when-open {
  display: inline;
}

.panel-body {
  padding: 0 18px 18px;
}

.p-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.p-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-ui {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.15s;
  flex-shrink: 0;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ivory);
  transition: transform 0.15s;
}

.switch input:checked + .switch-ui {
  background: var(--brass);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(14px);
  background: var(--room-deep);
}

.switch input:focus-visible + .switch-ui {
  outline: 2px solid var(--brass-hi);
  outline-offset: 2px;
}


.score {
  display: flex;
  gap: 18px;
  margin: 0;
}

.score div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score dt {
  font-size: 12px;
  color: var(--muted);
}

.score dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* table rules panel */

.p-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.panel[open] .p-summary {
  visibility: hidden;
}

.rules-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 10px 28px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(15, 81, 72, 0.22);
  border: 1px solid rgba(212, 175, 106, 0.2);
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px dashed rgba(212, 175, 106, 0.15);
}

.rule-label {
  font-size: 13px;
  color: var(--ivory);
}

.rule-row .seg button {
  min-width: 58px;
  height: 32px;
}

.rule-row .select {
  min-width: 110px;
  height: 32px;
}

.rules-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.rules-actions .btn {
  min-height: 40px;
  font-size: 13px;
}

.btn[data-armed="1"] {
  border-color: var(--warn);
  color: var(--warn);
}

.rules-form[title]:not([title=""]) {
  opacity: 0.6;
}


/* ---------- baccarat table ---------- */

.bac {
  --cw: 52px;
  --ch: 73px;
  --pc: #3f7fd0;
  --pc-hi: #8db8f2;
  --bc: #d0475a;
  --bc-hi: #f29aa6;
  --tc: #2fa36b;
}

.bac-felt {
  position: relative;
  aspect-ratio: 2.2 / 1;
  border-radius: 22px 22px 50% 50% / 22px 22px 70% 70%;
  overflow: hidden;
  background-color: var(--felt);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    radial-gradient(90% 70% at 40% 28%, var(--felt-hi), var(--felt) 55%, var(--felt-deep));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 18px 40px -10px rgba(0, 0, 0, 0.55), inset 0 -30px 60px -20px rgba(0, 0, 0, 0.6);
}

.table-rim {
  border-radius: 34px 34px 50% 50% / 34px 34px 72% 72%;
}

.table-rim::before {
  border-radius: 30px 30px 50% 50% / 30px 30px 72% 72%;
}

.table-wrap {
  max-width: none;
}

/* shoe, discards and burn card (top left) */

.shoe-zone {
  position: absolute;
  top: 5%;
  left: 3%;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shoe {
  width: 86px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shoe-box {
  position: relative;
  display: block;
  height: 50px;
  border-radius: 6px 10px 6px 6px;
  background: linear-gradient(160deg, #3d2a22, #160c08 70%);
  clip-path: polygon(0 18%, 70% 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.35);
}

.shoe-card {
  position: absolute;
  left: 8px;
  top: 16px;
  width: 50px;
  height: 27px;
  border-radius: 3px;
  background: var(--room-2);
  background-image: repeating-linear-gradient(45deg, rgba(212, 175, 106, 0.35) 0 1px, transparent 1px 5px);
  box-shadow: 0 0 0 2px var(--ivory) inset;
  transform: skewX(-12deg);
}

.shoe.shuffling .shoe-box {
  animation: shuffle 0.25s ease-in-out 6 alternate;
}

@keyframes shuffle {
  from { transform: translateX(-3px) rotate(-2deg); }
  to { transform: translateX(3px) rotate(2deg); }
}

.shoe-meter {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.shoe-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--fill, 1) * 100%);
  background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi));
  transition: width 0.3s;
}

/* the white cut card, measured from the end of the shoe */
.shoe-cut {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: calc(var(--cut, 0.05) * 100%);
  width: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.shoe.cut-out .shoe-cut {
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.9);
}

.shoe.cut-out .shoe-box::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 6px;
  width: 6px;
  height: 36px;
  border-radius: 1px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  transform: rotate(14deg);
}

.shoe-left {
  font-size: 11px;
  color: var(--ink);
  line-height: 1.2;
}

.discard {
  width: 54px;
}

.tray {
  position: relative;
  display: block;
  height: 56px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: rgba(0, 0, 0, 0.18);
}

.tray-fill {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: calc(var(--fill, 0) * 48px);
  min-height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(0deg, var(--ivory) 0 1px, #cfc4ae 1px 2px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: height 0.4s;
}

.burn {
  --cw: 44px;
  --ch: 62px;
}

.burn .bc {
  box-shadow: 0 0 0 2px var(--warn), 0 6px 14px rgba(0, 0, 0, 0.5);
  border-radius: 5px;
}

/* Player and Banker boxes */

.hands {
  position: absolute;
  top: 5%;
  left: 17%;
  width: 42%;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hand-box {
  --side: var(--pc);
  --side-hi: var(--pc-hi);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: calc(var(--ch) + 58px);
  padding: 8px 10px 22px;
  border: 2px solid var(--side);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.3s, transform 0.3s;
}

.hand-box[data-side="B"] {
  --side: var(--bc);
  --side-hi: var(--bc-hi);
}

.hb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hb-name {
  font-family: "Bodoni Moda", var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--side-hi);
}

.hb-total {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 50%;
  background: var(--side);
  color: #fff;
  font-family: "Bodoni Moda", serif;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.hb-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ch);
}

.hb-squeezer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hand-box.won {
  box-shadow: 0 0 0 2px var(--side-hi), 0 0 26px 2px var(--side), inset 0 0 30px rgba(255, 255, 255, 0.08);
}

.hand-box.won::after {
  content: "WIN";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--side);
  color: #fff;
  font-family: "Bodoni Moda", serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.bac-felt.tie .hand-box {
  box-shadow: 0 0 0 2px #7fe0ad, 0 0 24px 2px var(--tc);
}

/* cards: the face lies under the back; squeezing clips the back from one edge */

.bc {
  position: relative;
  flex-shrink: 0;
  width: var(--cw);
  height: var(--ch);
  --p: 0;
  border-radius: calc(var(--cw) * 0.08);
  filter: drop-shadow(-1px 3px 4px rgba(0, 0, 0, 0.45));
  user-select: none;
  -webkit-user-select: none;
}

.bc.third {
  margin: 0 calc((var(--ch) - var(--cw)) / 2);
  transform: rotate(90deg);
}

.bc-in,
.bc-face,
.bc-back {
  position: absolute;
  inset: 0;
}

.bc svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bc-back {
  transition: opacity 0.2s;
}

/* squeeze.js sets the back's clip-path (and the curl's) inline, so the fold can
   run straight from any edge or diagonally from any corner. */

.bc[data-state="up"] .bc-back {
  opacity: 0;
}

/* the lifted flap along the fold */
.bc-curl {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.bc[data-state="peel"] .bc-curl {
  display: block;
}

/* Thumbs pressed on the corner indices while a card is squeezed, so the value
   has to be read from the pips. They lift away once the card is turned over. */
.bc-thumbs {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.bc-thumb {
  position: absolute;
  width: 28%;
  aspect-ratio: 40 / 84;
  transform-origin: 50% 21%;
  opacity: 0;
  filter: drop-shadow(1px 3px 3px rgba(0, 0, 0, 0.45));
  -webkit-mask-image: linear-gradient(180deg, #000 52%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 52%, transparent 96%);
  transition: opacity 0.35s ease, translate 0.35s ease;
}

.bc-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* The tip pad sits on the index; the thumb reaches in from outside the card. */
.bc-thumb.tl {
  left: 11%;
  top: 17.5%;
  transform: translate(-50%, -21%) rotate(140deg);
}

.bc-thumb.br {
  left: 89%;
  top: 82.5%;
  transform: translate(-50%, -21%) rotate(-40deg);
}

.bc.held .bc-thumb {
  opacity: 1;
}

.bc.held[data-state="up"] .bc-thumb {
  opacity: 0;
}

.bc.held[data-state="up"] .bc-thumb.tl {
  translate: -18% -10%;
}

.bc.held[data-state="up"] .bc-thumb.br {
  translate: 18% 10%;
}

/* A card squeezed from underneath: the indices are at the bottom left... */
.bc-thumb.bl {
  left: 11%;
  top: 82.5%;
  transform: translate(-50%, -21%) rotate(40deg);
}

.bc.held[data-state="up"] .bc-thumb.bl {
  translate: -18% 10%;
}

/* ...and the top right. */
.bc-thumb.tr {
  left: 89%;
  top: 17.5%;
  transform: translate(-50%, -21%) rotate(-140deg);
}

.bc.held[data-state="up"] .bc-thumb.tr {
  translate: 18% -10%;
}

.bc.dealt {
  animation: deal-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.bc.third.dealt {
  animation-name: deal-in-third;
}

@keyframes deal-in {
  from {
    opacity: 0;
    transform: translate(-60px, -30px) rotate(-12deg) scale(0.85);
  }
}

@keyframes deal-in-third {
  from {
    opacity: 0;
    transform: translate(-60px, -30px) rotate(60deg) scale(0.85);
  }
}

/* roadmap board (top right) */

.roads {
  position: absolute;
  top: 4%;
  right: 3%;
  width: 37%;
  z-index: 3;
  padding: 6px 8px 7px;
  border-radius: 10px;
  background: #f7f2e6;
  color: #2b2118;
  box-shadow: 0 0 0 2px var(--brass-lo), 0 0 0 4px #24120b, 0 0 0 5px rgba(212, 175, 106, 0.6), 0 12px 24px rgba(0, 0, 0, 0.55);
  font-family: var(--font-ui);
}

.rd-head,
.rd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.3;
}

.rd-head {
  margin-bottom: 4px;
}

.rd-foot {
  margin-top: 4px;
  color: #6c5d48;
}

.rd-title {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #7a5520;
}

.rd-count {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.rd-count b {
  font-weight: 800;
}

.c-b { color: #c0233a; }
.c-p { color: #1f4fb7; }
.c-t { color: #1a8a4b; }

.c-pair,
.c-n {
  color: #6c5d48;
}

.roads svg {
  display: block;
  width: 100%;
  height: auto;
}

.rd-sub {
  margin-top: 3px;
}

.rg line {
  stroke: #d8ccb2;
  stroke-width: 0.5;
}

.rd-new circle:last-of-type {
  animation: rd-blink 0.9s 2;
}

@keyframes rd-blink {
  50% { opacity: 0.2; }
}

.rd-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.rd-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
}

.lg-eye { border: 1.5px solid #c0233a; }
.lg-small { background: #c0233a; }
.lg-roach { width: 9px !important; height: 2px !important; border-radius: 1px !important; background: #c0233a; transform: rotate(-45deg); }

.rd-ask {
  display: flex;
  gap: 8px;
}

.ask {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.ask-b { color: #c0233a; background: rgba(192, 35, 58, 0.08); }
.ask-p { color: #1f4fb7; background: rgba(31, 79, 183, 0.08); }

.ask svg {
  width: 10px;
  height: 10px;
}

.ask-none {
  display: inline-block;
  width: 10px;
}

/* message and table print */

.bac-felt .felt-msg {
  top: 50%;
}

.bac-print {
  position: absolute;
  left: 50%;
  top: 57.5%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  transform: translateX(-50%);
  font-family: "Bodoni Moda", serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}

.bac-print span:first-child {
  font-size: 17px;
  color: rgba(241, 217, 154, 0.62);
}

.bac-print span:last-child {
  font-size: 11px;
  color: var(--ink-soft);
}

/* seats along the rail */

.seats {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.seat {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.seat-bets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  min-height: 20px;
}

.sb {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.sb-p { background: var(--pc); }
.sb-b { background: var(--bc); }
.sb-s { background: rgba(0, 0, 0, 0.45); color: var(--brass-hi); border: 1px solid rgba(212, 175, 106, 0.5); }

.plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 9px 2px 2px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  font-size: 11.5px;
  color: var(--ivory);
}

.plate:disabled {
  cursor: default;
}

.avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #555;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.pname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat[data-kind="you"] .plate {
  border-color: var(--brass-hi);
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--room-deep);
  font-weight: 700;
}

.seat[data-kind="you"] .avatar {
  background: var(--room-deep);
  box-shadow: inset 0 0 0 2px var(--brass-hi);
}

.seat[data-kind="vacant"] .plate {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.15);
  color: var(--ink);
}

.seat[data-kind="vacant"] .avatar {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(236, 214, 160, 0.4);
}

.can-sit .seat[data-kind="vacant"] .plate:hover {
  border-color: var(--brass-hi);
  color: var(--ivory);
}

.seat-no {
  position: absolute;
  bottom: -14px;
  font-family: "Bodoni Moda", serif;
  font-size: 10px;
  color: var(--ink-soft);
}

.seat-res {
  position: absolute;
  top: -16px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.seat-res[data-tone="good"] { color: var(--good); }
.seat-res[data-tone="bad"] { color: var(--bad); }

.seat.squeezing .plate {
  animation: squeeze-glow 0.9s ease-in-out infinite alternate;
}

@keyframes squeeze-glow {
  to { box-shadow: 0 0 0 2px var(--warn), 0 0 14px var(--warn); }
}

/* ---------- dock: chips and betting board ---------- */

.dock {
  position: relative;
  z-index: 6;
  margin-top: 14px;
  padding: 12px 16px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 14, 10, 0.94), rgba(14, 6, 5, 0.96));
  border: 1px solid rgba(212, 175, 106, 0.4);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  display: grid;
  gap: 12px;
}

.dock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 106, 0.18);
}

.dock .bank-value {
  font-size: 26px;
}

.bet-sum {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bet-sum strong {
  font-family: "Bodoni Moda", serif;
  font-size: 22px;
  color: var(--ivory);
  font-variant-numeric: tabular-nums lining-nums;
}

.dock .chips {
  justify-content: center;
  flex-wrap: wrap;
}

.c5 { --chip: #c73a3a; --chip-side: #7a1f1f; }
.c25 { --chip: #2e8b57; --chip-side: #1b5636; }
.c50 { --chip: #d98f20; --chip-side: #8a5a12; }
.c100 { --chip: #2a2a2e; --chip-side: #0c0c0e; }
.c500 { --chip: #6b3fa0; --chip-side: #3f235f; }
.c1000 { --chip: #c9a24a; --chip-side: #7c6024; }

.c100 span,
.c500 span,
.c1000 span {
  color: #fff;
}

.chip[aria-checked="true"] {
  transform: translateY(-6px);
  box-shadow: 0 0 0 3px var(--brass-hi), 0 0 16px rgba(241, 217, 154, 0.7), 0 8px 12px rgba(0, 0, 0, 0.5);
}

.board {
  display: grid;
  gap: 10px;
}

.board-main {
  display: grid;
  grid-template-columns: 1fr 0.62fr 1fr;
  grid-template-areas:
    "p t b"
    "pp t bp";
  gap: 8px;
}

.spot {
  --tone: rgba(212, 175, 106, 0.55);
  --tone-bg: rgba(212, 175, 106, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 52px;
  padding: 6px 8px;
  border: 1.5px solid var(--tone);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--tone-bg), rgba(0, 0, 0, 0.28));
  color: var(--ivory);
  text-align: center;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

.spot:hover:not(:disabled) {
  box-shadow: 0 0 0 1px var(--tone), 0 0 14px -2px var(--tone);
}

.spot:active:not(:disabled) {
  transform: scale(0.98);
}

.spot:disabled {
  cursor: default;
}

.spot-p { grid-area: p; --tone: var(--pc); --tone-bg: rgba(63, 127, 208, 0.22); min-height: 78px; }
.spot-b { grid-area: b; --tone: var(--bc); --tone-bg: rgba(208, 71, 90, 0.22); min-height: 78px; }
.spot-t { grid-area: t; --tone: var(--tc); --tone-bg: rgba(47, 163, 107, 0.2); }
.spot-pp { grid-area: pp; --tone: var(--pc); --tone-bg: rgba(63, 127, 208, 0.1); }
.spot-bp { grid-area: bp; --tone: var(--bc); --tone-bg: rgba(208, 71, 90, 0.1); }
.spot.tone-p { --tone: rgba(63, 127, 208, 0.75); --tone-bg: rgba(63, 127, 208, 0.1); }
.spot.tone-b { --tone: rgba(208, 71, 90, 0.75); --tone-bg: rgba(208, 71, 90, 0.1); }

.spot-name {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.25;
}

.spot-p .spot-name,
.spot-b .spot-name {
  font-family: "Bodoni Moda", var(--font-display);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.spot-p .spot-name { color: var(--pc-hi); }
.spot-b .spot-name { color: var(--bc-hi); }
.spot-t .spot-name { color: #8fe3b6; font-size: 17px; }

.spot-name b {
  color: var(--brass-hi);
}

.spot-pay {
  font-family: "Bodoni Moda", serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.spot-amt:empty {
  display: none;
}

.spot-amt {
  position: absolute;
  top: -8px;
  right: -6px;
  z-index: 1;
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--room-deep);
  font-weight: 800;
  font-size: 11.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.spot.has-bet {
  box-shadow: inset 0 0 0 1px var(--tone), 0 0 18px -6px var(--tone);
}

.spot[data-res="win"] {
  box-shadow: 0 0 0 2px var(--good), 0 0 18px rgba(127, 211, 168, 0.6);
}

.spot[data-res="lose"] {
  opacity: 0.55;
}

.spot[data-res="push"] {
  box-shadow: 0 0 0 2px var(--warn);
}

.side-wrap {
  border: 1px solid rgba(212, 175, 106, 0.25);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.side-wrap > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--brass-hi);
}

.side-wrap > summary::-webkit-details-marker {
  display: none;
}

.side-wrap > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--brass);
  border-bottom: 2px solid var(--brass);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.side-wrap[open] > summary::before {
  transform: rotate(45deg);
}

.side-count {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brass);
  color: var(--room-deep);
  font-size: 11px;
}

.side-count:empty {
  display: none;
}

/* Side bets sit in four labelled groups instead of one long row. */
.board-side {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 12px 12px;
}

.sgroup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px 10px;
  border: 1px solid rgba(212, 175, 106, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.07), rgba(0, 0, 0, 0.12));
}

.sg-pair { grid-column: span 7; }
.sg-six { grid-column: span 5; }
.sg-win { grid-column: span 5; }
.sg-cards { grid-column: span 7; }

.sg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
}

.sg-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--brass-hi);
}

.sg-desc {
  font-size: 11.5px;
  color: var(--muted);
}

.sg-spots {
  display: grid;
  gap: 6px;
}

.sg-pair .sg-spots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-six .sg-spots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-win .sg-spots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-cards .sg-spots { grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); }

.sgroup .sg-spots {
  flex: 1;
  grid-auto-rows: 1fr;
}

.sg-cards .sg-spots {
  grid-template-rows: auto 1fr 1fr;
  grid-auto-rows: auto;
}

.sg-cards [data-spot="monkey"] {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.sg-sub {
  grid-column: 2 / -1;
  grid-row: 1;
}

.sg-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.spot-s {
  min-height: 50px;
}

.spot-mini {
  min-height: 44px;
  padding: 4px;
}

.spot-mini .spot-name {
  font-family: "Bodoni Moda", serif;
  font-size: 14px;
}

.board-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* Sticks to the bottom of the screen while the table is in view, so the visitor
   can rebet and deal without scrolling down to the board. */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border: 1px solid rgba(212, 175, 106, 0.45);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, rgba(36, 16, 12, 0.96), rgba(16, 6, 5, 0.98));
  box-shadow: 0 -10px 24px -10px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ab-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.ab-info b {
  margin-right: 8px;
  font-family: "Bodoni Moda", serif;
  font-size: 19px;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Player / Tie / Banker in the console, with a chip that steps through the
   denominations, so a bet can be placed while watching the table. */
.ab-bets {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ab-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ab-chips .chip {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.ab-chips .chip span {
  font-size: 11.5px;
}

.ab-chips .chip[aria-checked="true"] {
  transform: translateY(-4px);
}

/* "Watch" (sit this game out) is set apart from Deal and coloured differently. */
.btn-watch {
  margin: 0 18px 0 10px;
  min-width: 96px;
  border-color: #6f8fb0;
  background: linear-gradient(180deg, #4b6a8c, #2c4560);
  color: #fff;
  box-shadow: 0 3px 0 #1a2a3c;
}

.btn-watch:hover:not(:disabled) {
  border-color: #9ec0e2;
}

.btn-watch:disabled {
  opacity: 0.4;
}

.spot.ab-spot {
  min-width: 96px;
  min-height: 44px;
  padding: 4px 14px;
  border-radius: 10px;
}

.ab-spot .spot-name {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.ab-p { --tone: var(--pc); --tone-bg: rgba(63, 127, 208, 0.28); }
.ab-b { --tone: var(--bc); --tone-bg: rgba(208, 71, 90, 0.28); }
.ab-t { --tone: var(--tc); --tone-bg: rgba(47, 163, 107, 0.24); min-width: 72px; }
.ab-p .spot-name { color: var(--pc-hi); }
.ab-b .spot-name { color: var(--bc-hi); }
.ab-t .spot-name { color: #8fe3b6; }

.ab-spot:disabled {
  opacity: 0.55;
}

.ab-spot[data-res="lose"] {
  opacity: 0.45;
}

.dock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.dock-actions .btn-deal {
  min-width: 150px;
}

.btn-rebuy {
  margin-right: auto;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 18px;
  margin: 0;
  padding: 10px 12px;
  list-style: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px;
}

.results li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.r-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r-stake {
  color: var(--muted);
  font-size: 12px;
}

.results li[data-tone="good"] b { color: var(--good); }
.results li[data-tone="bad"] b { color: var(--bad); }

.results .r-total {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid rgba(212, 175, 106, 0.2);
}

/* ---------- squeeze overlay ---------- */

.sq {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(10, 30, 26, 0.75), rgba(5, 1, 2, 0.9));
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.sq[hidden] {
  display: none;
}

.sq-panel {
  width: min(94vw, 600px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 2px solid var(--side, var(--brass));
  background-color: var(--felt);
  background-image: radial-gradient(90% 80% at 50% 20%, var(--felt-hi), var(--felt) 60%, var(--felt-deep));
  box-shadow: 0 0 0 6px #24120b, 0 0 0 7px rgba(212, 175, 106, 0.55), 0 30px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.sq[data-side="P"] .sq-panel { --side: var(--pc); }
.sq[data-side="B"] .sq-panel { --side: var(--bc); }

.sq-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--brass-hi);
}

.sq-cards {
  display: flex;
  justify-content: center;
  gap: 40px;
  min-height: 200px;
}

.bc.big {
  --cw: min(36vw, 172px);
  --ch: calc(var(--cw) * 1.4);
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(-2px 8px 12px rgba(0, 0, 0, 0.55));
}

.bc.big.grab {
  cursor: grabbing;
}

.bc.big:focus-visible {
  outline: 3px solid var(--brass-hi);
  outline-offset: 4px;
}

.bc.big[data-state="up"] {
  cursor: default;
  animation: sq-done 0.4s ease-out;
}

@keyframes sq-done {
  50% { transform: scale(1.05); }
}

.sq-hint {
  margin: 14px auto 10px;
  max-width: 46ch;
  font-size: 12.5px;
  color: rgba(244, 235, 214, 0.85);
}

body.sq-open {
  overflow: hidden;
}

/* What the squeezer can see beside the card: the other hand (top left) and, on a
   third card that settles the coup, a quick guide to what wins (bottom right). */
.sq .sq-panel {
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.sq:has(.sq-ctx:not([hidden])) .sq-panel {
  width: min(96vw, 880px);
}

.sq-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "ctx cards quick";
  gap: 16px;
}

.sq-ctx {
  grid-area: ctx;
  align-self: start;
  justify-self: end;
  display: grid;
  gap: 6px;
  text-align: left;
}

.sq-ctx[hidden],
.sq-quick[hidden] {
  display: none;
}

.sq-stage .sq-cards {
  grid-area: cards;
}

.sq-quick {
  grid-area: quick;
  align-self: end;
  justify-self: start;
}

.sq-hand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid var(--hc, var(--brass));
  background: rgba(0, 0, 0, 0.3);
}

.sq-hand[data-side="P"] { --hc: var(--pc); }
.sq-hand[data-side="B"] { --hc: var(--bc); }

.sq-hl {
  min-width: 4.6em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ivory);
  white-space: nowrap;
}

.sq-minis {
  display: flex;
  gap: 3px;
}

.mc {
  display: block;
  width: 26px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.mc svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sq-ht {
  min-width: 24px;
  height: 24px;
  margin-left: 2px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Bodoni Moda", serif;
  font-size: 15px;
  color: #fff;
  background: var(--hc, var(--brass));
}

.sq-qt {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.sq-qt caption {
  padding: 0 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brass-hi);
  text-align: left;
}

.sq-qt th,
.sq-qt td {
  padding: 3px 5px;
  border-bottom: 1px solid rgba(212, 175, 106, 0.16);
}

.sq-qt tr:last-child th,
.sq-qt tr:last-child td {
  border-bottom: 0;
}

.sq-qt thead th {
  font-size: 11px;
  color: var(--ivory);
}

.sq-qt th[data-col="win"] { color: #8fe3b5; }
.sq-qt th[data-col="tie"] { color: #b7e7ff; }
.sq-qt th[data-col="lose"] { color: #f2a0a0; }

.sq-qt tbody th {
  text-align: left;
  font-weight: 700;
  color: rgba(244, 235, 214, 0.9);
  white-space: nowrap;
}

.sq-qt td {
  min-width: 58px;
}

.sq-qt td[data-col="win"] { background: rgba(31, 122, 90, 0.22); }
.sq-qt td[data-col="tie"] { background: rgba(60, 140, 180, 0.16); }
.sq-qt td[data-col="lose"] { background: rgba(150, 40, 40, 0.18); }

.sq-qt td .mc {
  display: inline-block;
  width: 18px;
  height: 25px;
  margin: 0 1px;
  vertical-align: middle;
}

.qt-none {
  color: rgba(244, 235, 214, 0.35);
}

@media (max-width: 760px) {
  .sq-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ctx" "cards" "quick";
    gap: 10px;
  }

  .sq-ctx {
    justify-self: start;
  }

  .sq-quick {
    justify-self: end;
  }

  .sq-hand {
    padding: 4px 6px;
  }

  .mc {
    width: 22px;
    height: 31px;
  }
}

/* ---------- shoe report ---------- */

.rp-panel {
  width: min(94vw, 680px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-color: var(--brass);
}

.rp-panel .kicker {
  margin: 0 0 2px;
}

.rp-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ivory);
}

.rp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.rp-box {
  padding: 10px 14px 12px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.rp-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--brass-hi);
}

.rp-list {
  margin: 0;
}

.rp-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(212, 175, 106, 0.14);
}

.rp-list > div:last-child {
  border-bottom: 0;
}

.rp-list dt {
  font-size: 12.5px;
  color: var(--muted);
}

.rp-list dd {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--ivory);
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

.rp-main dd {
  font-family: "Bodoni Moda", serif;
  font-size: 20px;
  color: var(--brass-hi);
}

/* Bodoni's minus sign reads like a strike-through next to "$". */
.rp-main #rp-net {
  font-family: inherit;
  font-size: 19px;
}

.rp-list dd[data-tone="good"] { color: var(--good); }
.rp-list dd[data-tone="bad"] { color: var(--bad); }

.rp-note {
  margin: 14px auto 12px;
  max-width: 52ch;
  font-size: 12.5px;
  color: rgba(244, 235, 214, 0.85);
}

#rp-next {
  min-width: 240px;
}

/* ---------- panels ---------- */

.pay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
  background: rgba(10, 4, 5, 0.55);
}

.pay-table th,
.pay-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(212, 175, 106, 0.16);
  text-align: left;
  vertical-align: top;
}

.pay-table thead th {
  background: rgba(212, 175, 106, 0.12);
  color: var(--brass-hi);
  white-space: nowrap;
}

.pay-table tbody th {
  color: var(--brass-hi);
  white-space: nowrap;
  font-weight: 700;
}

.pay-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 106, 0.28);
}

.score {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.score dd {
  font-family: "Bodoni Moda", serif;
  font-size: 20px;
  color: var(--brass-hi);
}

.score dd[data-tone="good"] { color: var(--good); }
.score dd[data-tone="bad"] { color: var(--bad); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .bac {
    --cw: 44px;
    --ch: 62px;
  }

  .hands {
    left: 16%;
    width: 42%;
    gap: 8px;
  }

  .roads {
    width: 40%;
  }

  .seat {
    width: 82px;
  }

  .plate {
    font-size: 10.5px;
  }

  .bac-print span:first-child {
    font-size: 14px;
  }

  .shoe-zone {
    flex-direction: column;
    gap: 6px;
  }

  .shoe {
    width: 70px;
  }

  .discard {
    display: none;
  }
}

@media (max-width: 760px) {
  main {
    padding: 0 10px 32px;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 16px 4px 10px;
  }

  .intro-lead {
    font-size: 13px;
  }

  .game-bar {
    justify-content: flex-start;
    padding: 0 4px;
  }

  .settings {
    gap: 8px 14px;
  }

  .bac {
    --cw: 40px;
    --ch: 56px;
  }

  .table-rim {
    padding: 8px;
    border-radius: 24px 24px 34% 34% / 24px 24px 6% 6%;
  }

  .table-rim::before {
    inset: 5px;
    border-radius: 20px 20px 34% 34% / 20px 20px 6% 6%;
  }

  .bac-felt {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "roads"
      "msg"
      "hands"
      "shoe"
      "seats";
    gap: 10px;
    padding: 10px 8px 40px;
    border-radius: 18px 18px 34% 34% / 18px 18px 5% 5%;
  }

  .roads {
    grid-area: roads;
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    padding: 5px 6px 6px;
  }

  .rd-head,
  .rd-foot {
    font-size: 10px;
  }

  .shoe-zone {
    grid-area: shoe;
    position: relative;
    top: auto;
    left: auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .shoe {
    width: 150px;
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
  }

  .shoe .shoe-box {
    grid-row: span 2;
  }

  .shoe-box {
    height: 36px;
  }

  .shoe-card {
    top: 10px;
    width: 38px;
    height: 20px;
  }

  .burn {
    --cw: 34px;
    --ch: 48px;
  }

  .dock-head {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .bank-label {
    white-space: nowrap;
  }

  .hands {
    grid-area: hands;
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    gap: 8px;
  }

  .hand-box {
    padding: 6px 6px 20px;
    min-height: calc(var(--ch) + 48px);
  }

  .hb-name {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .hb-total {
    min-width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .hb-cards {
    gap: 3px;
  }

  .bac-felt .felt-msg {
    grid-area: msg;
    position: relative;
    top: auto;
    left: auto;
    max-width: 100%;
    margin: 0 auto;
    transform: none;
    white-space: normal;
    font-size: 13px;
  }

  @keyframes pop {
    from { opacity: 0.4; transform: scale(0.97); }
    to { opacity: 1; transform: none; }
  }

  .bac-print {
    display: none;
  }

  .seats {
    grid-area: seats;
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 6px;
    padding: 14px 0 6px;
  }

  .seat {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    order: var(--order);
    transform: none;
  }

  .seat-no {
    bottom: -13px;
  }

  .dock {
    padding: 10px 10px 12px;
  }

  .dock .bank-value {
    font-size: 22px;
  }

  .bet-sum strong {
    font-size: 18px;
  }

  .dock .chips {
    gap: 6px;
  }

  .chip {
    width: 46px;
    height: 46px;
  }

  .spot-p,
  .spot-b {
    min-height: 66px;
  }

  .spot-p .spot-name,
  .spot-b .spot-name {
    font-size: 15px;
    letter-spacing: 0.02em;
  }

  .spot-t .spot-name {
    font-size: 14px;
  }

  .spot-name {
    font-size: 12px;
  }

  .board-main {
    gap: 6px;
  }

  .board-side {
    gap: 8px;
    padding: 4px 8px 10px;
  }

  .sg-pair,
  .sg-six,
  .sg-win,
  .sg-cards {
    grid-column: 1 / -1;
  }

  .sg-win .sg-spots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sg-cards .sg-spots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .sg-cards [data-spot="monkey"],
  .sg-sub {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .sgroup {
    padding: 7px 8px 8px;
  }

  .ab-bets {
    width: 100%;
    gap: 6px;
  }

  .spot.ab-spot {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 6px;
  }

  .ab-t {
    flex-grow: 0.7;
  }

  .ab-spot .spot-name {
    font-size: 13px;
  }

  .rp-grid {
    grid-template-columns: 1fr;
  }

  .rp-title {
    font-size: 18px;
  }

  #rp-next {
    width: 100%;
    min-width: 0;
  }

  .action-bar {
    margin: 10px -4px 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .ab-info {
    width: 100%;
    justify-content: center;
    font-size: 11px;
  }

  .ab-info b {
    font-size: 16px;
  }

  .ab-chips {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .ab-chips .chip {
    width: 40px;
    height: 40px;
  }

  .dock-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 6px;
    margin-left: 0;
  }

  .btn-watch {
    margin: 0 10px 0 0;
    min-width: 0;
  }

  .dock-actions .btn {
    min-height: 44px;
    padding: 0 6px;
    font-size: 13px;
  }

  .dock-actions .btn-deal {
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    font-size: 15px;
  }

  .btn-rebuy {
    grid-column: 1 / -1;
  }

  .sq-cards {
    gap: 12px;
  }

  .bc.big {
    --cw: min(40vw, 160px);
  }

  .sq-title {
    font-size: 16px;
  }

  .panel > summary {
    padding: 12px 14px;
  }

  .p-title {
    font-size: 17px;
  }

  .panel-body {
    padding: 0 12px 14px;
  }

  .pay-table {
    font-size: 12px;
  }

  .pay-table td:nth-child(2) {
    min-width: 200px;
  }

  .rule-row {
    flex-wrap: wrap;
    padding: 4px 0;
  }
}

@media (hover: none) {
  .act-keys-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bc.dealt {
    animation: none;
  }
}
