.jp-baccarat {
  --jp-ink: #203d38;
  --jp-muted: #52645c;
  --jp-line: #d4d7c9;
  --jp-paper: #fffdf7;
  width: min(100%, 1220px);
  margin: 0 auto;
  box-sizing: border-box;
  color: var(--jp-ink);
  word-break: keep-all;
}
.jp-game-screen {
  display: flex;
  flex-direction: column;
  /* Keep the table and its flexible card row steady when the browser bars retract on scroll. */
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
.jp-baccarat *,
.jp-baccarat *::before,
.jp-baccarat *::after {
  box-sizing: border-box;
}
.jp-baccarat [hidden] {
  display: none !important;
}
.jp-baccarat :is(h1, h2, h3, p, ul, fieldset) {
  margin: 0;
}
.jp-baccarat button,
.jp-baccarat input {
  font: inherit;
}
.jp-baccarat button {
  cursor: pointer;
}
.jp-baccarat button:disabled {
  cursor: default;
}
.jp-baccarat :is(button, input):focus-visible {
  outline: 3px solid #ad6726;
  outline-offset: 3px;
}
.jp-page-title,
.jp-rules header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.jp-page-title {
  flex: none;
  gap: clamp(5px, 1vw, 15px);
  min-height: 40px;
  padding: 3px clamp(6px, 1.4vw, 18px);
}
.jp-page-title h1 {
  flex: 1;
  min-width: 0;
  font: 400 clamp(1.13rem, 2vw, 1.6rem)/1.18 Jua, sans-serif;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.jp-table-tools { display: flex; align-items: center; gap: 5px; }
.jp-page-title .brand { flex: none; gap: 4px; color: #294c3b; }
.jp-page-title .brand img { width: 33px; height: 33px; }
.jp-page-title .brand span { gap: 1px; }
.jp-page-title .brand strong { font-size: 22px; }
.jp-page-title .brand small { font-size: 7px; letter-spacing: 1.6px; }
.jp-page-title .jp-rule-trigger { min-height: 32px; padding: 4px 9px; font-size: .78rem; }
.jp-page-title a.jp-rule-trigger { text-decoration: none; }
.jp-rule-trigger {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid #aeb9aa;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--jp-ink);
  font-size: 0.83rem;
  font-weight: 700;
}
.jp-rule-trigger span {
  width: 15px;
  height: 15px;
  border: 1.5px solid;
  border-radius: 50%;
  line-height: 13px;
  font-size: 11px;
  font-family: sans-serif;
}
.jp-rule-trigger:hover {
  background: #deeadb;
}

.jp-scene {
  --jp-stage-height: clamp(102px, 23svh, 238px);
  --jp-rear-rail: clamp(22px, 5.6svh, 58px);
  --jp-front-rail: clamp(10px, 2.3svh, 24px);
  flex: 1 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  --table-felt: #0d3c21;
  --table-wood: #6c4433;
  --table-side: clamp(2px, .32vw, 5px);
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #193e2c;
  box-shadow: 0 2px 0 #53301d, 0 14px 26px -13px #27351eb8;
}
.jp-dealer-area {
  position: relative;
  z-index: 1;
  container-type: inline-size;
  --dealer-seat: var(--dealer-x);
  --banker-seat: var(--banker-x);
  --banker-rail-cover: min(55.2px, calc(var(--jp-stage-height) * .216));
}
.jp-stage {
  position: relative;
  container-type: size;
  --dealer-height: min(100cqh, 44.16cqw);
  --seated-height: min(112cqh, 57cqw);
  --notch-width: calc(var(--dealer-height) * 1.94);
  --wood-stroke: clamp(4px, .96svh, 10px);
  isolation: isolate;
  height: calc(var(--jp-stage-height) * 1.2);
  background: #d6e9ce url('/assets/baccarat-cast/pavilion.webp') center 54% / cover no-repeat;
}
/* Both actors sit behind the rail. The dealer’s separate forearm layer can reach onto the felt. */
.jp-stage-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.jp-cast-layer, .jp-dealer-layer { display: contents; }
.jp-stage-viewport::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: var(--banker-rail-cover);
  border-inline: var(--table-side) solid var(--table-wood);
  pointer-events: none;
}
.jp-cast[data-role="dealer"] { left: var(--dealer-seat, var(--cast-x)); max-height: var(--dealer-height); }
.jp-cast[data-role="banker"] { left: var(--banker-seat, var(--cast-x)); }
.jp-table-rim {
  position: absolute;
  z-index: 2;
  bottom: -1px;
  left: var(--dealer-seat);
  transform: translateX(-50%);
  width: var(--notch-width);
  height: var(--banker-rail-cover);
  overflow: visible;
  pointer-events: none;
}
.jp-rim-lip, .jp-rim-wood, .jp-rim-binding {
  fill: none;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.jp-rim-lip { stroke: #3f291e; stroke-width: clamp(6px, 1.2svh, 12px); }
.jp-rim-wood { stroke: url(#jp-rail-grain) var(--table-wood); stroke-width: var(--wood-stroke); }
.jp-rim-binding { stroke: #bd896a; stroke-opacity: .54; stroke-width: .8px; }
.jp-dealer-speech {
  /* The dealer's head scales with the stage. Keep the tail beside his cheek. */
  --face-clearance: calc(var(--dealer-height) * .28 + 4px);
  --speech-size: .95rem;
  --speech-lines: 2;
  position: absolute;
  z-index: 3;
  top: 3px;
  right: calc(100% - var(--dealer-seat) + var(--face-clearance));
  width: min(13.5rem, calc(var(--dealer-seat) - var(--face-clearance) - 8px));
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 13px;
  border: 1px solid #9d7a4f;
  border-radius: 14px;
  background: #fff9e9;
  color: #263e32;
  box-shadow: 0 2px 5px #45322336;
  pointer-events: none;
}
.jp-dealer-speech::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 56%;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border-top: 1px solid #9d7a4f;
  border-right: 1px solid #9d7a4f;
  background: #fff9e9;
}
.jp-dealer-speech:has(.jp-dealer-line:empty) { opacity: 0; }
.jp-dealer-speaker {
  color: #735228;
  font-size: .68rem;
  font-weight: 750;
  line-height: 1.2;
}
.jp-dealer-line {
  min-height: calc(var(--speech-lines) * 1.35em);
  font-size: var(--speech-size);
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.jp-banker-hud { display: contents; }
.jp-bank-plaque {
  --portrait-clearance: calc(var(--jp-stage-height) * .32 + 4px);
  position: absolute;
  z-index: 3;
  top: max(4px, calc(var(--jp-stage-height) - var(--banker-rail-cover) - 62px));
  left: calc(var(--banker-seat) + var(--portrait-clearance));
  display: grid;
  gap: 1px;
  justify-items: start;
  max-width: min(143px, calc(100% - var(--banker-seat) - var(--portrait-clearance) - 6px));
  padding: 6px 14px 7px;
  border: 1px solid #d3b47b;
  border-radius: 8px;
  background: #3e332d;
  box-shadow: 0 2px 5px #442c2238;
  color: #f4deb5;
  line-height: 1.15;
  pointer-events: none;
}
.jp-bank-label {
  font-size: .69rem;
  font-weight: 750;
}
.jp-bank-plaque strong {
  color: #fff2d4;
  font: 800 1.24rem/1.04 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.jp-bank-plaque small { color: #f2d8b4; font-size: .64rem; }
.jp-bank-plaque small:empty { display: none; }
.jp-bank-plaque[data-mood="worried"] { border-color: #e5b980; }
.jp-bank-plaque[data-mood="crying"] { border-color: #acccdc; }
.jp-banker-speech {
  --portrait-clearance: min(12%, calc(var(--jp-stage-height) * .37));
  position: absolute;
  z-index: 4;
  top: max(4%, calc(100% - var(--banker-rail-cover) - 31cqw));
  left: calc(var(--banker-seat) + var(--portrait-clearance) + 3px);
  width: max-content;
  max-width: calc(100% - var(--banker-seat) - var(--portrait-clearance) - 6px);
  padding: 4px 8px;
  border: 1px solid #9b6d73;
  border-radius: 10px 10px 10px 3px;
  background: #fff2ed;
  box-shadow: 0 2px 4px #51332d2b;
  color: #522c39;
  font-size: clamp(.7rem, 1.6vw, .93rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.jp-banker-speech::before {
  content: '';
  position: absolute;
  left: -4px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: inherit;
  border-left: inherit;
  border-bottom: inherit;
}
.jp-banker-speech:empty { opacity: 0; }
.jp-cast {
  position: absolute;
  display: block;
  left: var(--cast-x);
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px #463c322f);
  pointer-events: none;
}
.jp-cast-body, .jp-cast-face {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
}
.jp-cast--framed {
  /* Anchor the bottom of the visible costume to the seat, even in tall, narrow stages. */
  --portrait-height: min(calc((100cqh - var(--banker-rail-cover) - 3.6px) / var(--cast-frame-end)),
    calc(26.4cqw / var(--cast-aspect)));
  height: var(--portrait-height);
  bottom: calc(var(--banker-rail-cover) - var(--portrait-height) * var(--cast-remainder) - 1px);
}
.jp-cast-body {
  inset: 0;
  width: 100%;
  height: 100%;
}
.jp-cast-face { height: auto; }
.jp-felt {
  position: relative;
  isolation: isolate;
  background: var(--table-felt);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto auto auto auto auto;
  align-items: center;
  row-gap: clamp(2px, .65svh, 7px);
  padding: calc(var(--jp-rear-rail) * .44) clamp(13px, 4.2vw, 60px) var(--jp-front-rail);
  color: #faf8eb;
}
.jp-felt::before, .jp-scene::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  /* Fill the clear corners at the foot of the curved wooden apron. */
  background: linear-gradient(to top, #3f291e calc(var(--jp-front-rail) * .16), transparent calc(var(--jp-front-rail) * .22));
  border-image: url('/assets/baccarat-cast/table-felt-wood.webp') 0 40 214 40 fill /
    0 3% var(--jp-front-rail) 3% / 0 stretch;
  border-radius: inherit;
  pointer-events: none;
}
.jp-scene::before { display: none; }
.jp-felt > * { grid-column: 1 / -1; min-width: 0; }
.jp-felt :is(button, input):focus-visible {
  outline: 3px solid #fff7d6;
  outline-offset: 4px;
}
.jp-felt-top {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) minmax(0, 2.5fr) minmax(100px, 1fr);
  grid-template-areas: "brand funds clock" "status funds clock";
  align-items: center;
  gap: 0 clamp(8px, 2vw, 24px);
}
.jp-table-brand {
  grid-area: brand;
  align-self: end;
  color: #e7cf9c;
  font: 700 .82rem/1.2 Georgia, serif;
  letter-spacing: .16em;
}
.jp-table-status {
  grid-area: status;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e6efd9;
  font-size: .78rem;
  font-weight: 700;
}
.jp-table-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b4e3b0;
}
.jp-funds {
  grid-area: funds;
  display: grid;
  justify-self: center;
  width: 100%;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 4px 17px;
  padding: 3px 8px;
  border-radius: 9px;
  border: 1px solid #bda57869;
  background: #112e22ba;
}
.jp-wallet, .jp-reserve, .jp-fee {
  --amount-size: 1.03rem;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  color: #d8e5d8;
  font-size: .76rem;
  font-weight: 700;
}
.jp-wallet { --amount-size: 1.8rem; }
.jp-funds strong {
  /* Fit the complete formatted amount; the value row stays at its normal text height. */
  font-size: var(--amount-size);
  font-size: min(var(--amount-size), calc(145cqi / var(--amount-length, 1)));
  line-height: calc(var(--amount-size) * 1.2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.jp-wallet strong {
  color: #ffe4a5;
  font-weight: 850;
}
.jp-reserve, .jp-fee {
  padding-left: 12px;
  border-left: 1px solid #bda57869;
}
.jp-reserve strong, .jp-fee strong {
  color: #fff0c8;
  font-weight: 800;
}
.jp-play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: min(100%, 750px);
  justify-self: center;
  margin: 0;
}
.jp-hand {
  --hand-zoom-scale: 1.85;
  --final-card-zoom-scale: 1.12;
  --card-width: clamp(36px, 6.5svh, 72px);
  --card-overlap: clamp(5px, 1vw, 10px);
  position: relative;
  z-index: 0;
  transform-origin: 20% 75%;
  transition: transform 360ms cubic-bezier(.25, .75, .3, 1), z-index 0s 360ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.jp-hand-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.jp-hand-name {
  font-size: clamp(0.94rem, 1.7vw, 1.2rem);
  font-weight: 750;
}
.jp-score {
  min-width: 23px;
  height: 23px;
  padding: 0 4px;
  border-radius: 7px;
  background: #092f29a6;
  color: #f5dfa3;
  text-align: center;
  font:
    700 14px/23px Nunito,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.jp-cards {
  /* Keep the rail the same width when a third card joins the two-card hand. */
  width: calc(var(--card-width) * 3 - var(--card-overlap) * 2);
  display: flex;
  justify-content: flex-start;
  padding: 2px 0 6px;
  align-items: center;
}
.jp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  flex-shrink: 0;
  width: var(--card-width);
  height: calc(var(--card-width) / .697);
  padding: 5px;
  border: 1px solid #dad7c8;
  border-radius: 6px;
  background: #fffdf4;
  box-shadow: 0 4px 8px #051a1838;
  color: #193d34;
  font-family: Georgia, serif;
  user-select: none;
  transition: translate 360ms ease-out, scale 360ms ease-out, rotate var(--third-turn-time) ease-in-out;
}
.jp-cards:has(> :nth-child(2):last-child) > .jp-card {
  translate: calc((var(--card-width) - var(--card-overlap)) / 2) 0;
}
.jp-card + .jp-card {
  margin-left: calc(0px - var(--card-overlap));
}
.jp-card:first-child {
  transform: rotate(-4deg) translateY(2px);
}
.jp-card:last-child {
  transform: rotate(4deg) translateY(2px);
}
.jp-card--0, .jp-card--1 {
  animation: jp-card-deal 0.24s ease-out backwards;
  transform-origin: center bottom;
}
@media (prefers-reduced-motion: no-preference) {
  .jp-card--turning { rotate: y 89deg; }
}
@keyframes jp-card-deal {
  from {
    opacity: 0;
    transform: translate(0, -14px) rotateY(60deg);
  }
}
.jp-card--red {
  color: #a82b2c;
}
.jp-card:not(.jp-card--back) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-shadow: 0 2px 4px #051a1848;
}
.jp-card-corner,
.jp-card-end {
  font-weight: 700;
  font-size: clamp(0.78rem, 1.3vw, 1.04rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.jp-card-end {
  justify-self: end;
  transform: rotate(180deg);
}
.jp-card-pip {
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: min(1em, 100%);
  height: 100%;
  max-height: 1em;
  min-height: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  line-height: 1;
}
.jp-card-pip .ui-icon { width: 100%; height: 100%; }
.jp-card--back {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 4px, #f1d4a82b 4px 5px),
    repeating-linear-gradient(-45deg, transparent 0 4px, #f1d4a82b 4px 5px),
    #26554d;
  color: #f5dfb1;
  border: 3px solid #fff5e6;
  outline: 1px solid #c6b796;
  outline-offset: -5px;
}
.jp-card--back .ui-icon {
  width: 58%;
  height: auto;
}
.jp-hand--banker { transform-origin: 80% 75%; }
.jp-hand:has(.jp-cards[data-zoom]) {
  z-index: 2;
  transform: scale(var(--hand-zoom-scale));
  transition: transform 720ms cubic-bezier(.35, .05, .25, 1), z-index 0s;
}
.jp-hand:has(.jp-cards[data-zoom]) .jp-hand-title {
  background: #173d30;
  border-radius: 4px;
  box-shadow: 0 0 0 3px #173d30;
}
.jp-cards[data-zoom] > .jp-card:nth-child(3) {
  scale: var(--final-card-zoom-scale);
  transform-origin: center bottom;
  animation: none;
}
.jp-cards[data-zoom="win"] > .jp-card:nth-child(3) {
  outline: 2px solid #ffe398;
  box-shadow: 0 0 7px 2px #ffe6a5d6, 0 0 19px 6px #efb84782;
  animation: jp-winning-card .52s ease-out var(--third-turn-time);
}
@keyframes jp-winning-card {
  0%, 100% { translate: 0 0; }
  18% { translate: -3px 0; }
  38% { translate: 3px 0; }
  58% { translate: -2px 0; }
  79% { translate: 1px 0; }
}
.jp-center-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  color: #b4d9c0;
}
.jp-center-line::before,
.jp-center-line::after {
  content: '';
  width: 1px;
  height: 24px;
  background: #cde3cd52;
}
.jp-center-line i {
  font:
    18px/1 Georgia,
    serif;
}

.jp-announcement {
  display: grid;
  align-items: center;
  min-height: 40px;
}
.jp-announcement > * { grid-area: 1 / 1; }
.jp-announcement:has(.jp-bet-note:not(:empty), .jp-controls button:not([hidden])) .jp-table-message { visibility: hidden; }
.jp-table-message {
  --summary-lines: 1;
  display: grid;
  gap: 2px;
  text-align: center;
  margin: 0;
}
.jp-table-message strong {
  color: #fff8e9;
  font-size: clamp(1rem, 2vw, 1.23rem);
  letter-spacing: -.035em;
  line-height: 1.35;
}
.jp-table-message span {
  color: #e1eadc;
  font-size: .8rem;
  line-height: 1.45;
  block-size: calc(var(--summary-lines) * 1.45em);
  overflow: auto;
  overflow-wrap: anywhere;
}

.jp-zones {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .73fr) minmax(0, 1fr);
  gap: clamp(4px, .7vw, 10px);
  align-items: center;
  width: min(96%, 940px);
  justify-self: center;
  margin: 0;
  perspective: 760px;
}
.jp-zone {
  --zone-ink: #e5f2ff;
  --zone-line: #d4dece;
  --zone-wash: #295c74;
  --seat-skew: 0deg;
  --seat-rotation: 0deg;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: clamp(54px, 8.4svh, 82px);
  padding: 8px 4px;
  color: var(--zone-ink);
  border: 0;
  border-radius: 2px;
  background: transparent;
  text-align: center;
}
.jp-zone--player {
  --seat-skew: -10deg;
  --seat-rotation: 3deg;
}
.jp-zone--banker {
  --zone-ink: #ffe6df;
  --zone-wash: #883d43;
  --seat-skew: 10deg;
  --seat-rotation: -3deg;
}
.jp-zone--tie {
  --zone-ink: #fff0bb;
  --zone-wash: #766038;
  translate: 0 7%;
}
.jp-zone::before, .jp-zone::after {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  transform: rotate(var(--seat-rotation)) skewX(var(--seat-skew)) rotateX(8deg);
}
.jp-zone::before {
  inset: 0;
  border: 2px solid var(--zone-line);
  border-radius: 2px;
  background: color-mix(in srgb, var(--zone-wash) 59%, transparent);
  box-shadow: inset 0 0 0 3px #102e2642;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.jp-zone::after {
  inset: 6px 7px;
  border-top: 1px solid color-mix(in srgb, var(--zone-line) 47%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--zone-line) 47%, transparent);
}
.jp-zone-label {
  color: var(--zone-ink);
  font: 750 .69rem/1.1 Nunito, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.jp-zone-name {
  color: #fffcef;
  font-size: clamp(1.05rem, 2.2vw, 1.42rem);
  line-height: 1.25;
  font-weight: 800;
}
.jp-zone-odds {
  color: var(--zone-ink);
  font-size: .74rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.jp-zone:has([data-placed]:not([hidden]))::before {
  border-color: #ffe5ac;
  box-shadow: inset 0 0 0 2px #e7cc89;
}
.jp-placed {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  max-width: calc(100% - 14px);
  min-width: 43px;
  min-height: 30px;
  padding: 3px 8px;
  border: 3px dashed #a3783f;
  border-radius: 50%;
  background: #ffe4a0;
  box-shadow: inset 0 0 0 1px #efc26c, 0 2px 0 #8b632f,
    0 calc(3px + var(--stack-levels, 0) * 2px) 0 #eac578,
    0 calc(5px + var(--stack-levels, 0) * 2px) 0 #79582f,
    0 calc(8px + var(--stack-levels, 0) * 2px) 5px #102a20a6;
  color: #3c2b12;
  font: 900 .75rem/1.05 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.jp-chip-rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px clamp(8px, 2vw, 22px);
}
.jp-table-stake { min-width: 0; }
.jp-fee-guide {
  text-align: center;
  color: #e9e8cd;
  font-size: .75rem;
  line-height: 1.45;
}
.jp-fee-guide:empty { display: none; }
.jp-chip-row,
.jp-chips,
.jp-custom {
  display: flex;
  align-items: center;
}
.jp-table-stake:has(.jp-refund[hidden]) { display: none; }
.jp-refund {
  border: 1px solid #dac29185;
  border-radius: 99px;
  background: #203b2f;
  color: #ffedc9;
  padding: 4px 14px;
  min-height: 44px;
  font-size: .8rem;
  font-weight: 750;
}
.jp-refund:disabled { opacity: .56; }
.jp-chip-row { gap: clamp(10px, 2vw, 26px); }
.jp-chip-title {
  color: #f1e8cd;
  font-size: .83rem;
  font-weight: 750;
}
.jp-chips {
  flex-wrap: wrap;
  padding: 5px 8px;
  border-radius: 99px;
  background: #183d30;
  box-shadow: inset 0 2px 4px #13261bbd, inset 0 -1px 0 #b89b605e;
  gap: clamp(8px, 1.15vw, 15px);
}
.jp-chips .jp-chip {
  --chip-face: #e7dbc5;
  --chip-dash: #77634b;
  --chip-ink: #3a3126;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(40px, 6svh, 53px);
  aspect-ratio: 1;
  padding: 0 3px;
  border: 1px solid #ffffff57;
  border-radius: 50%;
  background: var(--chip-face);
  color: var(--chip-ink);
  font: 900 clamp(.78rem, 1.25vw, .98rem)/1.1 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 #14382e, 0 5px 7px #142f2b50;
  transition: transform .16s ease, box-shadow .16s ease;
}
.jp-chip-edge {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  stroke: var(--chip-dash);
}
.jp-chips [data-amount="5"] {
  --chip-face: #a13e45;
  --chip-dash: #f0c4ae;
  --chip-ink: #fff5dd;
}
.jp-chips [data-amount="10"] {
  --chip-face: #305b85;
  --chip-dash: #bfdae1;
  --chip-ink: #fff9e9;
}
.jp-chips [data-amount="25"] {
  --chip-face: #426649;
  --chip-dash: #d8dfab;
  --chip-ink: #fff9dc;
}
.jp-chips .jp-chip--custom {
  --chip-face: #49404e;
  --chip-dash: #d5c0cb;
  --chip-ink: #fff7e3;
  font-family: inherit;
  font-size: .73rem;
}
.jp-chips .jp-chip[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #215143, 0 0 0 4px #ffdc8f, 0 6px 6px #112c2590;
  transform: translateY(-2px);
}
.jp-chips .jp-chip:disabled:not([aria-pressed="true"]) {
  opacity: .62;
}
.jp-custom {
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex-basis: auto;
  margin: 0;
  color: #f3efda;
  font-size: .83rem;
}
.jp-custom input {
  width: min(11rem, 100%);
  min-width: 0;
  min-height: 43px;
  padding: 5px 10px;
  border: 1px solid #cfba84;
  border-radius: 8px;
  background: #fffbeb;
  color: #203d35;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.jp-clock {
  grid-area: clock;
  display: grid;
  gap: 3px;
  color: #e1ebda;
  font-size: .76rem;
}
.jp-clock-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 1.5rem;
  line-height: 1.4;
}
.jp-clock-label strong {
  color: #f6e5ae;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.jp-clock-track {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #adc1a057;
}
.jp-clock-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e4cd91;
  transition: width .2s linear;
}
.jp-clock--urgent .jp-clock-label strong { color: #ffb4a1; }
.jp-clock--urgent .jp-clock-track i { background: #f49d7d; }

.jp-bonus-panel {
  width: min(96%, 940px);
  justify-self: center;
  margin-bottom: 0;
}
.jp-bonus-panel .jp-bonus-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
  color: #f1e5c9;
  font-size: .91rem;
  line-height: 1.3;
}
.jp-bonus-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #c5ba915e;
}
.jp-bonus-zones {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.jp-bonus-zones .jp-bonus-zone {
  --zone-wash: #2c4b39;
  --zone-line: #b1ad85;
  --chip-font-size: .7rem;
  --odds-size: .78rem;
  /* Settlement replaces the odds with an outcome and possibly a payout. */
  grid-template-rows: auto minmax(calc(var(--odds-size) * 2.4), auto)
    minmax(calc(var(--chip-font-size) * 1.05 + 6px), auto);
  min-height: 57px;
  gap: 2px;
  padding: 6px;
}
.jp-bonus-zone::before {
  border-width: 1px;
  border-radius: 5px;
  transform: none;
}
.jp-bonus-zone::after { content: none; }
.jp-bonus-detail { display: contents; }
.jp-bonus-zone[data-side="coverAll"] {
  --zone-wash: #4c4130;
  --zone-line: #d2b67f;
}
.jp-bonus-name {
  color: #fff2d6;
  font: 700 clamp(.96rem, 1.55vw, 1.15rem)/1.17 Georgia, serif;
}
.jp-bonus-odds, .jp-bonus-outcome {
  color: #d5e7d7;
  align-self: center;
  font: 700 var(--odds-size)/1.2 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.jp-bonus-outcome { color: #ffdf91; }
.jp-bonus-payout::before { content: '· '; }
.jp-bonus-zone .jp-placed {
  position: static;
  transform: none;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding: 2px 8px;
  border: 1px dashed #926e3e;
  border-radius: 12px;
  box-shadow: none;
  font-size: var(--chip-font-size);
}

.jp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.jp-controls button {
  pointer-events: auto;
  flex: none;
  padding: 4px 12px;
  min-height: 32px;
  border: 1px solid #d0bd8d;
  border-radius: 99px;
  background: #f4e1b3;
  color: #284336;
  font-size: .83rem;
  font-weight: 750;
}
.jp-bet-note {
  flex: 1 1 5em;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #ffe0c9;
  font-size: .8rem;
  line-height: 1.45;
  text-align: center;
}
.jp-bet-note:empty { display: none; }
@media (hover: hover) {
  .jp-zone:hover:not(:disabled)::before {
    background-color: var(--zone-wash);
    box-shadow: inset 0 0 0 2px #f7e8b570;
    border-color: #f9e4a8;
  }
  .jp-chips .jp-chip:hover:not(:disabled) { transform: translateY(-3px); }
  .jp-controls button:hover { background: #fff0d0; }
  .jp-refund:not(:disabled):hover { background: #305340; }
}
.jp-zone[data-drag-over]::before {
  border-color: #ffebba;
  box-shadow: inset 0 0 0 3px #f0cb82;
}
.jp-zone--winner::before { border: 2px solid #ffe3a7; box-shadow: inset 0 0 0 2px #f7d079; }

.jp-zone:active:not(:disabled),
.jp-chips .jp-chip:active:not(:disabled) { transform: translateY(1px); }

.jp-road-panel {
  min-width: 0;
  margin: 18px 0 24px;
  padding: clamp(17px, 2vw, 25px);
  border: 1px solid var(--jp-line);
  border-radius: 20px;
  background: var(--jp-paper);
  box-shadow: 0 3px 0 #303d2c07;
}
.jp-baccarat h2 {
  color: var(--jp-ink);
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: -.045em;
}
.jp-road-panel h2 { margin-bottom: 13px; scroll-margin-top: 12px; }
.jp-rules {
  width: min(445px, calc(100vw - 28px));
  max-height: 85dvh;
  overflow: auto;
  margin: auto;
  background: var(--jp-paper);
  color: var(--jp-ink);
  border: 1px solid #aeb8a5;
  border-radius: 20px;
  padding: 23px;
  box-shadow: 0 18px 80px #142b273b;
  line-height: 1.65;
  font-size: 0.91rem;
}
.jp-rules::backdrop {
  background: #12352d70;
}
.jp-rules header {
  margin-bottom: 12px;
}
.jp-rules header button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--jp-line);
  border-radius: 50%;
  color: var(--jp-ink);
  background: transparent;
  font-size: 1.3rem;
}
.jp-rules h3 {
  font-size: 0.92rem;
  margin: 15px 0 4px;
}
.jp-rules ul {
  padding-left: 19px;
}
.jp-bonus-rules { margin: 4px 0 0; }
.jp-bonus-rules > div { padding: 6px 0; }
.jp-bonus-rules > div + div { border-top: 1px solid var(--jp-line); }
.jp-bonus-rules dt { font-weight: 800; }
.jp-bonus-rules dd { margin: 1px 0 0; }
.jp-rules .jp-rules-foot {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--jp-line);
}

@media (max-width: 760px) {
  .jp-scene { --jp-stage-height: clamp(102px, 22svh, 174px); }
  .jp-felt { padding-inline: clamp(9px, 2.8vw, 20px); }
  .jp-felt-top {
    grid-template-columns: minmax(0, 1fr) minmax(75px, 21%);
    grid-template-areas: "funds clock";
    column-gap: 7px;
  }
  .jp-table-brand, .jp-table-status { display: none; }
  .jp-funds { gap: 3px; padding: 3px 5px; }
  .jp-wallet, .jp-reserve, .jp-fee { align-items: center; }
  .jp-reserve, .jp-fee { padding-left: 3px; }
  .jp-play-area { gap: 2px; grid-template-columns: minmax(0, 1fr) 9px minmax(0, 1fr); }
  .jp-hand { --card-overlap: 7px; --card-width: clamp(38px, 5.8svh, 54px); }
  .jp-hand--player { transform-origin: 0% 70%; }
  .jp-hand--banker { transform-origin: 100% 70%; }
  .jp-center-line::before, .jp-center-line::after { height: 12px; }
  .jp-card { padding: 3px; }
  .jp-card-corner, .jp-card-end { font-size: .75rem; }
  .jp-card-pip { font-size: 1.22rem; }
  .jp-cast { left: var(--cast-mobile-x); }
  .jp-dealer-area { --dealer-seat: var(--dealer-mobile-x); --banker-seat: var(--banker-mobile-x); }
  .jp-dealer-speech { --speech-size: .8rem; --speech-lines: 2; padding: 5px 7px; }
  .jp-banker-speech { padding: 3px 4px; }
  .jp-bank-plaque {
    inset: auto auto 2px 3px;
    display: grid; gap: 1px;
    max-width: 17.8%; padding: 2px 4px;
  }
  .jp-bank-plaque strong { font-size: min(.85rem, 4.1cqw); }
  .jp-bank-label, .jp-bank-plaque small { font-size: .6rem; }
  .jp-table-message { --summary-lines: 2; gap: 0; }
  .jp-table-message strong { font-size: .93rem; }
  .jp-table-message span { font-size: .75rem; line-height: 1.25; block-size: calc(var(--summary-lines) * 1.25em); }
  .jp-bonus-panel { width: 100%; }
  .jp-bonus-zones { gap: 4px; }
  .jp-bonus-zones .jp-bonus-zone { --odds-size: .70rem; gap: 1px; padding: 3px; }
  .jp-bonus-name { font-size: .86rem; }
  .jp-zones { width: 98%; gap: 4px; }
  .jp-zone { gap: 1px; padding: 4px; }
  .jp-zone-name { font-size: 1rem; }
  .jp-zone-label { font-size: .60rem; }
  .jp-zone-odds { font-size: .70rem; }
  .jp-zones .jp-zone:has(.jp-placed:not([hidden])) .jp-zone-label,
  .jp-zones .jp-zone:has(.jp-placed:not([hidden])) .jp-zone-odds { visibility: hidden; }
  .jp-zones .jp-zone:has(.jp-placed:not([hidden])) .jp-zone-name { transform: translateY(-9px); }
  .jp-zones .jp-placed {
    inset: auto auto 7px 50%; transform: translateX(-50%);
    width: max-content; min-height: 18px; padding: 1px 5px;
    font-size: .66rem; border-width: 2px;
  }
  .jp-chip-title { display: none; }
  .jp-chips { gap: 5px; padding: 3px 4px; flex-wrap: nowrap; }
  .jp-chips .jp-chip { width: clamp(35px, 7.5vw, 46px); }
  .jp-refund { min-height: 35px; padding: 3px 8px; }
  .jp-fee-guide { font-size: .71rem; line-height: 1.3; }
}
@media (max-width: 550px) {
  .jp-page-title { min-height: 37px; gap: 4px; }
  .jp-page-title .brand img { width: 27px; height: 27px; }
  .jp-page-title .brand strong { font-size: 18px; }
  .jp-page-title .brand small { font-size: 6px; letter-spacing: 1px; }
  .jp-venue-name, .jp-rule-trigger span { display: none; }
  .jp-table-tools { gap: 3px; }
  .jp-page-title .jp-rule-trigger { padding: 3px 6px; font-size: .72rem; }
  .jp-scene { border-radius: 12px; }
  .jp-wallet { --amount-size: 1.43rem; }
  .jp-reserve, .jp-fee { --amount-size: .85rem; }
  .jp-funds > * { font-size: .67rem; }
  .jp-clock-label { min-height: 1.25rem; flex-direction: column-reverse; line-height: 1.1; gap: 1px; font-size: .62rem; }
  .jp-clock-label strong { font-size: 1rem; }
  .jp-dealer-speech { --speech-lines: 3; top: 5px; }
  .jp-bonus-zones .jp-bonus-zone { min-height: 45px; grid-template-rows: auto 1.15rem; }
  .jp-bonus-zone .jp-placed { grid-row: 2; }
  .jp-custom { flex-basis: 100%; gap: 4px; }
  .jp-custom input { min-height: 30px; padding: 2px 6px; }
}
@media (max-width: 550px) and (max-height: 699px) {
  .jp-scene { --jp-stage-height: clamp(80px, 17svh, 115px); --jp-rear-rail: 22px; --jp-front-rail: 7px; }
  .jp-felt { row-gap: 2px; }
  .jp-hand { --card-width: 35px; gap: 2px; }
  .jp-hand-name { font-size: .82rem; }
  .jp-score { height: 18px; min-width: 18px; font: 700 .73rem/18px Nunito,sans-serif; }
  .jp-play-area .jp-card { padding: 2px; }
  .jp-card-pip { font-size: 1rem; }
  .jp-bonus-panel .jp-bonus-title { font-size: .73rem; margin-bottom: 2px; }
  .jp-bonus-zones .jp-bonus-zone { min-height: 35px; padding: 1px 3px; }
  .jp-zone { min-height: 44px; }
  .jp-dealer-speech {
    --speech-size: .74rem; --face-clearance: calc(var(--dealer-height) * .30 + 3px);
    gap: 1px; padding: 3px 4px;
  }
  .jp-dealer-speaker { display: none; }
}

@media (min-width: 761px) and (max-width: 920px) and (orientation: portrait) {
  .jp-dealer-area { --dealer-seat: 43.5%; --banker-seat: var(--banker-mobile-x); }
}
@media (max-width: 550px) and (min-height: 700px) {
  .jp-bank-plaque { left: 1px; bottom: 0; max-width: 13.6%; padding: 2px; }
  .jp-bank-plaque strong { font-size: min(.81rem, 3.05cqw); }
}

@media (max-width: 550px) and (max-height: 620px) and (orientation: portrait) {
  .jp-scene { --jp-stage-height: clamp(50px, calc((100svh - 482px) / 1.2), 75px); --jp-rear-rail: 18px; }
  .jp-dealer-speech { top: 1px; }
  .jp-dealer-line { line-height: 1.2; min-height: 2.4em; }
  .jp-felt { row-gap: 1px; padding-bottom: 5px; }
  .jp-chip-rail { display: grid; grid-template-columns: max-content auto; gap: 2px 5px; }
  .jp-chip-rail .jp-refund { padding-inline: 5px; white-space: nowrap; }
  .jp-custom { grid-column: 1 / -1; }
  .jp-chips { gap: 3px; }
  .jp-zones .jp-zone { min-height: 44px; padding-block: 2px; line-height: 1.06; }
  .jp-bonus-title { line-height: 1.15; }
  .jp-hand { --card-width: 33px; }
  .jp-hand-name { line-height: 1.15; }
  .jp-felt .jp-cards { padding-block: 1px 3px; }
  .jp-funds > * { gap: 0; line-height: 1.2; }
  .jp-wallet { --amount-size: 1.35rem; }
  .jp-table-message span { line-height: 1.15; block-size: 2.3em; }
}

/* Keep the park emblem and every table control on one line on small phones. */
@media (max-width: 425px) {
  .jp-page-title .brand span { display: none; }
  .jp-page-title .jp-rule-trigger { padding-inline: 4px; }
}
@media (max-width: 370px) {
  .jp-page-title { padding-inline: 4px; gap: 2px; }
  .jp-page-title .brand { gap: 2px; }
  .jp-page-title .brand img { width: 23px; height: 23px; }
  .jp-page-title .brand strong { font-size: 16px; }
  .jp-page-title h1 { font-size: .94rem; }
}

@media (max-width: 310px) and (max-height: 540px) {
  .jp-dealer-speech {
    top: 0;
    padding-block: 1px;
    width: calc(var(--dealer-seat) - var(--face-clearance) - 3px);
  }
}

@media (max-width: 340px) {
  .jp-page-title [data-park-tools] .member-btn { width: 32px; padding: 0; justify-content: center; }
  .jp-page-title .member-btn span { display: none; }
  .jp-page-title [data-park-tools] .member-btn .ui-icon { display: block; width: 17px; height: 17px; }
}

@media (max-width: 550px) and (max-height: 540px) and (orientation: portrait) {
  .jp-hand { --card-width: 30px; }
  .jp-announcement { min-height: 31px; }
  .jp-table-message span { block-size: 1.2em; }
  .jp-bonus-zones .jp-bonus-zone { min-height: 32px; grid-template-rows: auto 1rem; gap: 0; }
  .jp-bonus-name { font-size: .8rem; line-height: 1.05; }
  .jp-zones .jp-zone { min-height: 41px; }
  .jp-chips .jp-chip { width: 32px; }
  .jp-chips { padding-block: 1px; }
  .jp-fee-guide { font-size: .67rem; line-height: 1.16; }
}

@media (min-width: 551px) and (max-width: 760px) and (min-height: 621px) and (max-height: 700px) {
  .jp-felt { row-gap: 1px; padding-block: 8px 10px; }
  .jp-chip-rail { column-gap: 6px; }
  .jp-custom input { width: 7rem; }
}

@media (min-width: 761px) and (min-height: 621px) and (max-height: 780px) {
  .jp-scene {
    --jp-stage-height: clamp(78px, calc(100svh - 605px), 170px);
    --jp-rear-rail: 29px;
    --jp-front-rail: 11px;
  }
  .jp-felt { row-gap: 3px; }
  .jp-dealer-speech { --face-clearance: calc(var(--dealer-height) * .77 + 3px); }
}

@media (orientation: landscape) and (max-height: 620px) and (min-width: 500px) {
  .jp-page-title { min-height: 32px; padding-block: 0; }
  .jp-scene {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    grid-template-rows: minmax(0, 1fr) auto auto auto auto auto;
    grid-template-areas: "actors feedback" "actors bonuses" "hands mains" "hands chips" "funds custom" "fees fees";
    align-items: center; gap: 3px 12px; padding: 5px 9px;
    border-radius: 9px; background: var(--table-felt);
  }
  .jp-dealer-area { grid-area: actors; align-self: stretch; min-height: 62px;
    --dealer-seat: var(--dealer-x); --banker-seat: 81%; --banker-rail-cover: clamp(10px, 3.5svh, 21px); }
  .jp-stage { position: absolute; inset: 0; height: auto; border-radius: 6px; --dealer-height: min(100cqh, 38.4cqw); }
  .jp-dealer-speech { --speech-size: .7rem; --speech-lines: 2; left: 2px; right: auto; width: 33%; top: 2px; padding: 3px 4px; gap: 1px; border-radius: 6px; }
  .jp-banker-speech { --portrait-clearance: 12%; padding: 2px 3px; font-size: .66rem; }
  .jp-bank-plaque {
    inset: auto auto 1px 2px; display: grid; gap: 0;
    max-width: 17.8%; padding: 2px 3px;
  }
  .jp-bank-plaque strong { font-size: min(.75rem, 4.5cqw); }
  .jp-bank-plaque small, .jp-bank-label { font-size: .58rem; }
  .jp-felt, .jp-chip-rail { display: contents; }
  .jp-felt::before { display: none; }
  .jp-scene::before { display: block; }

  .jp-felt > * { grid-column: auto; }
  .jp-felt-top { grid-area: funds; grid-template-columns: minmax(0,1fr) 49px; grid-template-areas: "funds clock"; gap: 3px; }
  .jp-table-brand, .jp-table-status { display: none; }
  .jp-wallet { --amount-size: 1.22rem; }
  .jp-reserve, .jp-fee { --amount-size: .78rem; }
  .jp-funds { width: 100%; gap: 2px; padding: 1px 3px; }
  .jp-funds > * { align-items: center; font-size: .62rem; }
  .jp-reserve, .jp-fee { padding-left: 2px; }
  /* Reserve both lines of the open timer's label through the reveal and results. */
  .jp-clock-label { flex-direction: column; gap: 0; font-size: .62rem; min-height: calc(2.8em + 1.12rem); }
  .jp-clock-label strong { font-size: .8rem; }
  .jp-play-area { grid-area: hands; align-self: center; }
  .jp-hand { --card-width: clamp(31px, 9svh, 42px); --card-overlap: 6px; gap: 1px; }
  .jp-card { padding: 2px; } .jp-card-pip { font-size: .95rem; }
  .jp-hand-name { font-size: .8rem; } .jp-score { min-width: 17px; height: 17px; font-size: .72rem; line-height: 17px; }
  .jp-announcement { grid-area: feedback; }
  .jp-table-message { --summary-lines: 2; }
  .jp-table-message strong { font-size: .86rem; }
  .jp-table-message span { font-size: .69rem; line-height: 1.2; block-size: 2.4em; }
  .jp-bonus-panel { grid-area: bonuses; width: 100%; }
  .jp-bonus-panel .jp-bonus-title { font-size: .73rem; margin-bottom: 2px; }
  .jp-bonus-zones { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; }
  .jp-bonus-zones .jp-bonus-zone { min-height: 47px; grid-column: auto; padding: 2px; grid-template-rows: auto auto; }
  .jp-bonus-name { font-size: .72rem; }
  .jp-bonus-odds, .jp-bonus-outcome { font-size: .61rem; }
  .jp-bonus-zone .jp-placed { font-size: .64rem; }
  .jp-zones { grid-area: mains; width: 98%; }
  .jp-zone { min-height: 42px; padding: 2px; gap: 0; }
  .jp-zone-label { font-size: .55rem; }
  .jp-zone-name { font-size: .88rem; }
  .jp-zone-odds { font-size: .62rem; }
  .jp-chip-rail { display: contents; }
  .jp-chip-row { grid-area: chips; justify-content: flex-start; }
  .jp-table-stake { grid-area: chips; justify-self: end; }
  .jp-chip-title { display: none; }
  .jp-chips { gap: 3px; padding: 2px 3px; flex-wrap: nowrap; }
  .jp-chips .jp-chip { width: clamp(29px, 4.6vw, 42px); }
  .jp-refund { padding: 2px 5px; min-height: 31px; font-size: .7rem; }
  .jp-custom { grid-area: custom; flex-wrap: nowrap; }
  .jp-custom input { width: min(10rem, 55%); min-height: 26px; padding-block: 1px; }
  .jp-fee-guide { grid-area: fees; font-size: .67rem; }
}

@media (max-width: 550px), (orientation: landscape) and (max-height: 620px) and (min-width: 500px) {
  .jp-bonus-detail:has(.jp-placed:not([hidden])) .jp-bonus-odds { display: none; }
  /* Chip and payout share the existing caption space after settlement. */
  .jp-bonus-detail:has(.jp-bonus-outcome:not([hidden])):has(.jp-placed:not([hidden])) {
    display: flex;
    grid-row: 2;
    flex-wrap: wrap;
    justify-content: center;
    align-self: center;
    align-items: center;
    column-gap: 2px;
    width: 100%;
    font: 700 .62rem/1.05 Nunito, sans-serif;
  }
  .jp-bonus-detail:has(.jp-placed:not([hidden])) .jp-bonus-outcome:not([hidden]) { display: contents; font: inherit; }
  .jp-bonus-payout { order: 2; }
  .jp-bonus-payout::before { content: none; }
  .jp-bonus-detail :is(.jp-bonus-hit, .jp-bonus-payout) {
    font-size: inherit;
    line-height: 1.05;
  }
  .jp-bonus-detail:has(.jp-bonus-outcome:not([hidden])) .jp-placed:not([hidden]) {
    order: 1;
    padding: 0 1px;
    font-size: inherit;
    line-height: 1;
  }
}

@media (max-width: 550px) and (orientation: portrait) {
  .jp-bonus-zone:has(.jp-bonus-outcome:not([hidden])):has(.jp-placed:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name chip" "settlement settlement";
    align-items: center;
    column-gap: 1px;
  }
  .jp-bonus-zone:has(.jp-placed:not([hidden])):has(.jp-bonus-outcome:not([hidden])) .jp-bonus-name {
    grid-area: name;
    font-size: min(.81rem, 3.5vw);
  }
  .jp-bonus-detail:has(.jp-bonus-outcome:not([hidden])):has(.jp-placed:not([hidden])) {
    display: contents;
  }
  .jp-bonus-detail:has(.jp-placed:not([hidden])) .jp-bonus-outcome:not([hidden]) {
    grid-area: settlement;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 3px;
    font: 700 .62rem/1.05 Nunito, sans-serif;
  }
  .jp-bonus-detail:has(.jp-bonus-outcome:not([hidden])) .jp-placed:not([hidden]) { grid-area: chip; }
}

/* Keep captions together below the hands when the seats fill the stage. */
@container (max-width: 520px) {
  .jp-banker-hud {
    position: absolute; inset: 100% 3px auto;
    display: flex; align-items: center; justify-content: flex-end; gap: 4px;
    pointer-events: none;
  }
  .jp-banker-speech {
    position: static; width: max-content; max-width: none; min-width: 0;
    padding: 1px 4px; font-size: .66rem; line-height: 1.12;
    text-wrap: balance;
  }
  .jp-banker-speech::before { display: none; }
  .jp-bank-plaque {
    position: static; display: flex; align-items: baseline; gap: 3px;
    flex-shrink: 0; max-width: none; padding: 1px 4px; white-space: nowrap;
  }
  .jp-bank-plaque strong { font-size: .71rem; }
  .jp-bank-plaque :is(.jp-bank-label, small) { font-size: .58rem; }
}

@media (max-width: 536px) {
  .jp-felt { padding-top: max(17px, calc(var(--jp-rear-rail) * .44)); }
}
@media (orientation: portrait) and (max-width: 536px) {
  .jp-scene { --hand-overhang: clamp(7px, calc(var(--jp-stage-height) * .1), 18px); }
  /* Extend the view into the felt without shifting the funds or card rows. */
  .jp-stage { --rail-drop: min(18px, calc(var(--jp-stage-height) * .11)); }
  .jp-stage-viewport { bottom: calc(-1 * var(--rail-drop)); background: inherit; }
  .jp-dealer-layer > .jp-cast { margin-bottom: calc(-1 * var(--rail-drop)); }
  .jp-banker-hud { top: calc(100% + var(--hand-overhang)); }
  .jp-felt { padding-top: calc(max(17px, var(--jp-rear-rail) * .44) + var(--hand-overhang)); }
}
@media (orientation: landscape) and (min-width: 500px) and (max-height: 620px) {
  @container (max-width: 520px) {
    .jp-stage { bottom: 27px; }
    .jp-banker-hud { inset: auto 2px 0; }
  }
  @container (max-width: 310px) {
    .jp-dealer-speaker { display: none; }
    .jp-dealer-line { line-height: 1.18; min-height: 2.36em; }
  }
}

@media (max-width: 760px), (orientation: landscape) and (max-width: 960px) and (max-height: 620px) {
  .jp-stage {
    /* The seated art uses a wider canvas than the banker portrait. Match their face scales
       and keep the flat back rail under the banker's entire bust. */
    --seated-height: min(97cqh, 48.5cqw);
    --notch-width: min(calc(var(--dealer-height) * 1.94), 72cqw);
  }
  .jp-bonus-zones {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "fortune cover blazing" "golden cover heavenly";
    gap: 3px;
  }
  .jp-bonus-zone[data-side="fortune7"]  { grid-area: fortune; }
  .jp-bonus-zone[data-side="coverAll"]  { grid-area: cover; }
  .jp-bonus-zone[data-side="blazing7s"] { grid-area: blazing; }
  .jp-bonus-zone[data-side="golden8"]   { grid-area: golden; }
  .jp-bonus-zone[data-side="heavenly9"] { grid-area: heavenly; }
}
@media (orientation: landscape) and (min-width: 500px) and (max-width: 960px) and (max-height: 620px) {
  .jp-dealer-area { --dealer-seat: 40%; }
  @container (max-width: 520px) {
    .jp-stage { bottom: 34px; }
  }
  @container (max-width: 310px) {
    /* Banker dialogue can wrap next to the plaque in a narrow split layout. */
    .jp-stage { bottom: 42px; }
  }
  .jp-bonus-zones .jp-bonus-zone { min-height: 37px; }
}

@media (prefers-reduced-motion: reduce) {
  .jp-card, .jp-cards[data-zoom="win"] > .jp-card:nth-child(3) { animation: none; }
  .jp-hand, .jp-hand:has(.jp-cards[data-zoom]), .jp-card { transition: none; }
  .jp-clock-track i, .jp-zone, .jp-chips .jp-chip { transition: none; }
}

/* The back edge of the wooden notch crosses at 82% of the rim SVG's height.
   Both passes share one image-space seat so the contact points track that edge. */
.jp-cast.jp-cast--seated[data-role="dealer"] {
  --wood-back-edge: calc(var(--banker-rail-cover) * .18 + var(--wood-stroke) * .5 - 1px);
  height: var(--seated-height);
  max-height: none;
  bottom: calc(var(--wood-back-edge) - var(--seated-height) * var(--below-rail));
  filter: none;
}
.jp-cast-atlas { background-repeat: no-repeat; }
.jp-bank-plaque[data-mood="tearing"], .jp-bank-plaque[data-mood="shocked"] { border-color: #acccdc; }
