:root {
  color-scheme: dark;
  --gold: #dcba73;
  --ivory: #f8edd2;
  --mint: #8ae3c0;
  --line: #b38a4d66;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
}
body {
  background: #140d1e url('assets/background.webp') center/cover fixed no-repeat;
  color: var(--ivory);
  overflow-x: hidden;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font:
    700 12px Arial,
    sans-serif;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #201729;
  border-radius: 8px;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:enabled {
  border-color: var(--gold);
  filter: brightness(1.12);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.room-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 70%, #16544422, transparent 65%),
    linear-gradient(#09081022, #10081700 60%, #07070daa);
  z-index: -1;
}
.topbar {
  height: clamp(95px, 14vh, 150px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px clamp(15px, 3vw, 56px);
  position: relative;
}
.back {
  color: #eed9ae;
  text-decoration: none;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: bold;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100e1bdd;
}
.logo {
  position: absolute;
  width: min(420px, 37vw);
  height: calc(100% - 10px);
  object-fit: contain;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 9px #000);
}
.top-tools {
  display: flex;
  gap: 7px;
}
.top-tools button {
  width: 38px;
  height: 38px;
  font-size: 18px;
  background: #15101ebf;
}
.table-shell {
  width: min(1480px, 94vw);
  margin: 0 auto 14px;
  position: relative;
}
.upper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24%;
  gap: 25px;
  height: clamp(260px, 35vh, 390px);
}
.pay-panel {
  background: linear-gradient(135deg, #1c172be8, #171020e8);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 24px 8px;
  box-shadow:
    inset 0 0 0 4px #dab97408,
    0 15px 50px #0004;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ad874742;
  padding-bottom: 10px;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 700;
}
.section-head small {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #c3b39d;
}
.pay-scroll {
  flex: 1;
  min-height: 0;
}
table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: clamp(12px, 1vw, 16px);
  font-variant-numeric: tabular-nums;
}
th:first-child,
td:first-child {
  text-align: left;
  width: 42%;
  padding-left: 8px;
}
th {
  color: #c6af86;
  font-size: 11px;
  letter-spacing: 1px;
}
td {
  text-align: center;
  color: #e5c37c;
}
tr + tr td {
  border-top: 1px solid #ffffff05;
}
td:first-child {
  color: #ebddc4;
}
td.active,
th.active {
  background: #46827321;
  color: #bff7d8;
}
tr.winner td {
  background: #bfa05e22;
  color: #ffedb6;
  font-weight: bold;
}
tr.winner td.active {
  background: #62dc9829;
  color: #d2ffe9;
}
.pay-note {
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin: 7px 0 0;
  color: #aa9c87;
}
.host {
  position: relative;
  isolation: isolate;
  min-width: 0;
}
.host > img {
  height: 112%;
  width: 100%;
  object-fit: contain;
  object-position: 50% 0;
  position: absolute;
  bottom: 0;
  animation: host-idle 8s ease-in-out infinite;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 10px 14px #0009);
}
.halo {
  position: absolute;
  inset: 5% -20% 10%;
  background: radial-gradient(ellipse, #b8934940, transparent 68%);
  z-index: -1;
}
.host-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 45px 5px 5px;
  background: linear-gradient(transparent, #120e22e6 68%);
  pointer-events: none;
}
.host-caption span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #cbb384;
}
.host-caption p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #f4e5bf;
}
.host.cheer > img {
  animation: host-cheer 850ms ease-in-out;
}
.message-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 14px 2px 12px;
  min-height: 28px;
}
.stage-tag {
  color: var(--mint);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  white-space: nowrap;
}
.message-row p {
  margin: 0;
  flex: 1;
  font-size: 13px;
  text-align: center;
  color: #e7d7ba;
}
.message-row > span:last-child {
  font-size: 10px;
  letter-spacing: 1px;
  color: #bbac8f;
}
.felt {
  position: relative;
  padding: 20px 5%;
  border-radius: 20px;
  border: 1px solid #98b4a244;
  background: radial-gradient(ellipse, #143b31ba, #08291edd);
  box-shadow:
    inset 0 0 50px #040f0d70,
    0 14px 24px #0004;
  overflow: visible;
  min-height: 180px;
}
.felt:before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid #dbba7140;
  border-radius: 15px;
  pointer-events: none;
}
.deck-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 32px);
  max-width: 1150px;
  margin: auto;
  align-items: start;
}
.card-slot {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}
.playing-card {
  padding: 0;
  position: relative;
  aspect-ratio: 2/3;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 10px 15px #0008;
  isolation: isolate;
  transition:
    transform 180ms,
    box-shadow 180ms;
  overflow: hidden;
}
.playing-card .card-face,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
}
.card-face {
  background: radial-gradient(ellipse at 30% 15%, #fffdf8, #f7efd9 90%);
  color: #15352e;
  border: 1px solid #ddc79c;
  box-shadow:
    inset 0 0 0 4px #fff6,
    inset 0 0 0 6px #b99b6050;
}
.red {
  color: #b12446;
}
.corner {
  position: absolute;
  left: 8%;
  top: 5%;
  font:
    500 clamp(20px, 2.7vw, 40px)/0.95 Georgia,
    serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.corner small {
  font: inherit;
  font-size: 0.77em;
  margin-top: 4px;
}
.corner.reverse {
  left: auto;
  top: auto;
  right: 8%;
  bottom: 5%;
  transform: rotate(180deg);
}
.pips {
  position: absolute;
  inset: 19% 15%;
  font:
    clamp(18px, 2.65vw, 42px) Georgia,
    serif;
}
.pips span {
  position: absolute;
  transform: translate(-50%, -50%);
}
.pips.ace {
  font-size: clamp(70px, 8vw, 122px);
}
.court {
  position: absolute;
  width: 74%;
  height: 82%;
  left: 13%;
  top: 9%;
  overflow: visible;
}
.joker-face img {
  position: absolute;
  inset: 10% 14% 13%;
  width: 72%;
  height: 76%;
  object-fit: contain;
}
.joker-face > strong {
  position: absolute;
  bottom: 9%;
  width: 100%;
  text-align: center;
  font: 700 14px Georgia;
  color: #744923;
  letter-spacing: 2px;
}
.joker-face .corner {
  font-size: 26px;
  color: #744923;
}
.card-back {
  background: radial-gradient(ellipse, #4a275d, #1e122d 80%);
  border: 5px solid #ece0c6;
  box-shadow:
    inset 0 0 0 2px #a9874d,
    inset 0 0 0 7px #321a3e;
}
.card-back:before {
  content: '';
  position: absolute;
  inset: 8px;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, #d9b76216 9px 10px),
    repeating-linear-gradient(-45deg, transparent 0 9px, #d9b76216 9px 10px);
  border: 1px solid #ba975066;
  border-radius: 3px;
}
.back-frame {
  position: absolute;
  inset: 14% 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid #e2c48d80;
  border-radius: 50%;
  background: #261633cc;
}
.back-frame > span {
  font: 80px Georgia;
  color: #d6b268;
  text-shadow: 0 3px 4px #000;
}
.back-frame b {
  font: 700 14px Georgia;
  color: #f0d59b;
  letter-spacing: 2px;
}
.back-frame i {
  font: 7px Arial;
  color: #c3a677;
  letter-spacing: 1px;
  margin-top: 8px;
}
.hold {
  width: 100%;
  min-height: 30px;
  color: #bdbba8;
  font-size: 10px;
  letter-spacing: 2px;
  background: #10392db0;
  border-color: #8bb69b40;
}
.card-slot.held .playing-card {
  transform: translateY(-8px);
  box-shadow:
    0 0 0 2px var(--mint),
    0 0 24px #5eedba30,
    0 15px 16px #0008;
}
.card-slot.held .hold {
  background: #aadfbd;
  color: #153426;
  border-color: #b8f6d3;
}
.card-slot.winner .playing-card {
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 30px #e0bd6366;
  animation: card-win 1300ms ease-in-out;
}
.playing-card:disabled {
  opacity: 1;
}
.card-slot.dealing {
  animation: deal 620ms cubic-bezier(0.16, 0.6, 0.25, 1) both;
  animation-delay: calc(var(--i)*90ms);
}
.card-slot.drawing .playing-card {
  animation: flip-in 500ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: calc(var(--i)*55ms);
}
.console {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 22px 24px;
  background: linear-gradient(120deg, #1f172cd9, #111720f0);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 3px #dbc07708,
    0 12px 20px #0005;
  min-height: 144px;
}
.display {
  min-width: 140px;
  flex: 1;
}
.display span,
.bet-control > span {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: #c8bba2;
  margin-bottom: 8px;
}
.display strong {
  font-size: clamp(25px, 2.5vw, 40px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.pot strong {
  color: var(--mint);
}
.bet-control {
  text-align: center;
  flex: none;
  min-width: 150px;
}
.bet-control > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
.bet-control strong {
  font-size: 22px;
  min-width: 40px;
}
.bet-control > div > button {
  width: 48px;
  height: 48px;
  font-size: 26px;
}
.small-link {
  border: 0;
  background: none;
  font-size: 10px;
  letter-spacing: 1px;
  color: #bca575;
  margin-top: 2px;
  padding: 8px;
  min-height: 44px;
}
.primary {
  background: linear-gradient(130deg, #edce88, #b99046);
  color: #281d13;
  min-height: 84px;
  min-width: 220px;
  padding: 12px 28px;
  letter-spacing: 1px;
  box-shadow:
    inset 0 1px 0 #fff7,
    0 3px 16px #c9953e1a;
  white-space: nowrap;
}
.primary > span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.4px;
  margin-top: 7px;
  font-weight: 400;
}
.risk-actions {
  display: flex;
  gap: 8px;
}
.secondary {
  padding: 16px 18px;
  background: #244b3a;
  border-color: #80b69a77;
  font-size: 12px;
  letter-spacing: 0.5px;
  min-height: 84px;
  min-width: 130px;
}
.secondary small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #b8e9cc;
}
.footer-note {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #cab797b0;
  margin: 12px 0 0;
}
.gamble-row {
  display: grid;
  grid-template-columns: 1fr 60px 4.5fr;
  gap: 25px;
  align-items: center;
  max-width: 1200px;
  margin: auto;
}
.dealer-box,
.choices-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.dealer-box > span,
.choices-box > span {
  color: #dbd1b4;
  font-size: 10px;
  letter-spacing: 2px;
  text-align: center;
}
.dealer-box > .playing-card {
  box-shadow:
    0 0 0 3px #d6b77890,
    0 12px 16px #0006;
}
.risk-divider {
  font: italic 26px Georgia;
  color: #c4a35b;
}
.choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.choice {
  transition: transform 0.18s;
}
.choice:hover:enabled {
  transform: translateY(-9px);
}
.choice.selected {
  box-shadow:
    0 0 0 3px var(--mint),
    0 0 30px #46ffbd66;
}
.choice.unselected {
  opacity: 0.65;
}
.choice.revealed {
  animation: flip-in 450ms ease-out;
}
.risking .pay-panel {
  opacity: 0.5;
  transition: opacity 0.4s;
}
.risking .host {
  filter: drop-shadow(0 0 20px #9657b822);
}
#sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}
#sparkles i {
  position: absolute;
  left: 50%;
  top: 60%;
  width: 5px;
  height: 5px;
  background: #d6bf7e;
  box-shadow: 0 0 8px #fff8;
  border-radius: 1px;
  animation: spark 1200ms ease-out both;
}
.error {
  padding: 14px 18px;
  border: 1px solid #bd7574;
  border-radius: 10px;
  background: #441e32e6;
  margin-top: 12px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.error button {
  padding: 10px 18px;
}
dialog {
  color: #f6e6c4;
  background: linear-gradient(145deg, #2a1b34, #101a20);
  border: 1px solid #c6a96d;
  border-radius: 18px;
  width: min(680px, 90vw);
  max-height: 85vh;
  padding: 35px;
  box-shadow: 0 30px 100px #000c;
}
dialog::backdrop {
  background: #050810c9;
  backdrop-filter: blur(6px);
}
dialog h1 {
  font: 32px Georgia;
  margin: 16px 0;
}
dialog h2 {
  font: 23px Georgia;
  margin-top: 28px;
}
dialog p {
  font-size: 14px;
  line-height: 1.65;
  color: #d7c6ad;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: #bba371;
}
.close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: none;
  width: 30px;
  height: 30px;
  font-size: 20px;
}
dialog .primary {
  min-height: 45px;
}
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: #150e20;
  transition: opacity 0.35s;
}
.loader img {
  width: min(560px, 70vw);
}
.loader span {
  font-size: 11px;
  letter-spacing: 2px;
  color: #baa276;
  margin-top: 30px;
}
.loader i {
  width: 180px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d9bd81, transparent);
  margin-top: 20px;
  animation: loader 1.5s ease-in-out infinite;
}
@keyframes host-idle {
  0%,
  100% {
    transform: translateY(0) rotate(-0.3deg);
  }
  50% {
    transform: translateY(-5px) rotate(0.3deg);
  }
}
@keyframes host-cheer {
  40% {
    transform: translateY(-14px) rotate(-2deg);
  }
  70% {
    transform: translateY(-5px) rotate(1deg);
  }
}
@keyframes deal {
  from {
    opacity: 0;
    transform: translate(180px, -80px) rotate(12deg) scale(0.7);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes flip-in {
  from {
    transform: perspective(850px) rotateY(80deg) translateY(-10px);
    opacity: 0.4;
  }
  to {
    transform: perspective(850px) rotateY(0);
    opacity: 1;
  }
}
@keyframes card-win {
  40% {
    transform: translateY(-10px) rotate(-1deg);
  }
  75% {
    transform: translateY(-3px) rotate(1deg);
  }
}
@keyframes spark {
  to {
    transform: translate(var(--x), var(--y)) rotate(300deg);
    opacity: 0;
  }
}
@keyframes loader {
  50% {
    opacity: 0.2;
    transform: scaleX(0.65);
  }
}
@media (min-width: 1600px) and (min-height: 950px) {
  .deck-row {
    max-width: 1250px;
  }
  .felt {
    padding-top: 22px;
    padding-bottom: 22px;
  }
  .playing-card {
    max-height: 360px;
  }
  .console {
    margin-top: 22px;
  }
}
@media (max-width: 1100px) {
  .table-shell {
    width: 96vw;
  }
  .upper {
    grid-template-columns: minmax(0, 1fr) 23%;
    gap: 14px;
    height: 280px;
  }
  .pay-panel {
    padding: 12px 15px 7px;
  }
  .console {
    gap: 12px;
    padding: 12px;
  }
  .risk-actions {
    flex-direction: column;
    gap: 4px;
  }
  .secondary {
    min-height: 35px;
    padding: 7px;
    font-size: 9px;
  }
  .secondary small {
    font-size: 9px;
    margin-top: 2px;
  }
  .display {
    min-width: 95px;
  }
  .bet-control {
    min-width: 125px;
  }
  .primary {
    padding: 13px 18px;
  }
  .section-head {
    letter-spacing: 1px;
  }
}
@media (max-width: 680px) {
  .topbar {
    height: 105px;
    padding: 10px 10px;
  }
  .back {
    padding: 10px 8px;
    font-size: 9px;
    letter-spacing: 1px;
  }
  .logo {
    width: 230px;
    height: 80px;
    top: 28px;
  }
  .top-tools {
    gap: 4px;
  }
  .top-tools button {
    width: 28px;
    height: 29px;
    font-size: 15px;
  }
  .table-shell {
    width: 96vw;
  }
  .upper {
    height: 270px;
    grid-template-columns: 1fr;
  }
  .host {
    display: none;
  }
  .pay-panel {
    padding: 10px 10px 5px;
    border-radius: 12px;
  }
  table {
    font-size: 11px;
  }
  th:first-child,
  td:first-child {
    width: 45%;
    padding-left: 1px;
  }
  .section-head {
    font-size: 8px;
    padding-bottom: 6px;
  }
  .section-head small,
  .pay-note {
    font-size: 8px;
  }
  .message-row {
    margin: 12px 1px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .message-row p {
    flex: 1 1 100%;
    order: 3;
    font-size: 11px;
    min-height: 15px;
  }
  .stage-tag,
  .message-row > span:last-child {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .felt {
    padding: 12px 10px;
    border-radius: 12px;
  }
  .felt:before {
    inset: 4px;
    border-radius: 9px;
  }
  .deck-row {
    gap: 7px;
  }
  .playing-card,
  .card-back,
  .card-face {
    border-radius: 5px !important;
  }
  .card-back {
    border-width: 2px;
  }
  .card-face {
    box-shadow: inset 0 0 0 2px #b99b6050;
  }
  .corner {
    font-size: 18px;
  }
  .corner small {
    margin-top: 2px;
  }
  .pips {
    font-size: 16px;
    inset: 23% 17%;
  }
  .pips.ace {
    font-size: 44px;
  }
  .court {
    width: 77%;
    left: 12%;
    height: 72%;
    top: 14%;
  }
  .hold {
    font-size: 7px;
    letter-spacing: 0.3px;
    min-height: 28px;
    border-radius: 5px;
  }
  .card-slot {
    gap: 7px;
  }
  .card-slot.held .playing-card {
    transform: translateY(-4px);
  }
  .back-frame {
    inset: 13% 10%;
  }
  .back-frame > span {
    font-size: 30px;
  }
  .back-frame b {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .back-frame i {
    display: none;
  }
  .joker-face > strong {
    font-size: 6px;
    letter-spacing: 0;
  }
  .joker-face .corner {
    font-size: 13px;
  }
  .console {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 12px 8px;
    padding: 13px 10px;
    margin-top: 12px;
  }
  .display {
    min-width: 0;
  }
  .display span,
  .bet-control > span {
    font-size: 7px;
    letter-spacing: 0.7px;
  }
  .display strong {
    font-size: 22px;
  }
  .bet-control {
    min-width: 0;
  }
  .bet-control > div {
    gap: 8px;
  }
  .bet-control strong {
    font-size: 19px;
    min-width: 28px;
  }
  .bet-control > div > button {
    width: 25px;
    height: 25px;
    font-size: 18px;
  }
  .small-link {
    font-size: 6px;
  }
  .primary {
    grid-column: 1/-1;
    width: 100%;
    min-height: 49px;
    padding: 10px;
    font-size: 11px;
  }
  .primary > span {
    font-size: 8px;
    margin-top: 5px;
  }
  .risk-actions {
    grid-column: 1/-1;
    grid-row: 2;
    flex-direction: row;
  }
  .risk-actions button {
    flex: 1;
    min-height: 44px;
    font-size: 9px;
  }
  .risk-actions small {
    font-size: 9px;
    margin-top: 5px;
  }
  .footer-note {
    font-size: 8px;
    line-height: 1.4;
    padding: 0 4px;
  }
  .gamble-row {
    grid-template-columns: 1fr 8px 4.4fr;
    gap: 8px;
  }
  .choices {
    gap: 6px;
  }
  .risk-divider {
    font-size: 9px;
  }
  .dealer-box > span,
  .choices-box > span {
    font-size: 6px;
    letter-spacing: 0.2px;
  }
  .dealer-box,
  .choices-box {
    gap: 8px;
  }
  .dealer-box .corner {
    font-size: 16px;
  }
  dialog {
    padding: 24px;
  }
  dialog h1 {
    font-size: 26px;
  }
  dialog p {
    font-size: 12px;
  }
}
@media (max-height: 650px) and (min-width: 681px) {
  .topbar {
    height: 80px;
    padding-top: 10px;
  }
  .logo {
    width: 260px;
  }
  .upper {
    height: 230px;
  }
  .pay-panel {
    padding: 8px 18px;
  }
  .section-head {
    padding-bottom: 4px;
  }
  .pay-note {
    margin-top: 4px;
    font-size: 8px;
  }
  table {
    font-size: 11px;
  }
  .host-caption p {
    font-size: 10px;
  }
  .felt {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .deck-row {
    max-width: 840px;
  }
  .gamble-row {
    max-width: 820px;
  }
  .message-row {
    margin: 8px 0;
    font-size: 11px;
  }
  .console {
    margin-top: 10px;
    padding: 8px 15px;
    min-height: 75px;
  }
  .display strong {
    font-size: 26px;
  }
  .primary {
    min-height: 50px;
  }
  .footer-note {
    margin-top: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
body.less-motion *,
body.less-motion *:before,
body.less-motion *:after {
  animation: none !important;
  transition: none !important;
}

/* Keep complete, proportional cards and controls inside a desktop viewport. */
@media (min-width: 681px) {
  .table-shell {
    --card-gap: clamp(12px, 2vw, 32px);
    --card-height: clamp(
      145px,
      calc(
        100svh - clamp(95px, 14vh, 150px) - clamp(260px, 35vh, 390px) - 225px
      ),
      340px
    );
  }
  .deck-row,
  .gamble-row {
    max-width: calc(var(--card-height)*10/3 + var(--card-gap)*4);
  }
  .playing-card {
    max-height: none;
  }
  .gamble-row {
    grid-template-columns: 1fr 50px 4fr;
    gap: 20px;
  }
  .choices {
    gap: var(--card-gap);
  }
  .corner {
    font-size: clamp(20px, calc(var(--card-height)*0.115), 40px);
  }
  .pips {
    font-size: clamp(19px, calc(var(--card-height)*0.12), 42px);
  }
  .pips.ace {
    font-size: calc(var(--card-height)*0.35);
  }
}
@media (max-height: 650px) and (min-width: 681px) {
  .upper {
    height: 180px;
  }
  .table-shell {
    --card-height: clamp(125px, calc(100svh - 410px), 240px);
  }
  .pay-note {
    display: none;
  }
  .section-head {
    font-size: 9px;
  }
  table {
    font-size: 10px;
  }
  .host-caption span {
    font-size: 8px;
  }
  .host-caption p {
    font-size: 9px;
  }
  .message-row {
    min-height: 23px;
  }
  .footer-note {
    font-size: 8px;
  }
}

@media (min-width: 681px) {
  :root {
    --top-height: clamp(95px, 12vh, 130px);
    --upper-height: clamp(230px, 28vh, 340px);
  }
  .topbar {
    height: var(--top-height);
  }
  .upper {
    height: var(--upper-height);
  }
  .table-shell {
    --card-height: clamp(
      140px,
      calc(100svh - var(--top-height) - var(--upper-height) - 290px),
      340px
    );
  }
  .halo {
    left: 0;
    right: 0;
  }
}
@media (max-height: 650px) and (min-width: 681px) {
  :root {
    --top-height: 80px;
    --upper-height: 180px;
  }
  .table-shell {
    --card-height: clamp(110px, calc(100svh - 430px), 200px);
  }
}

.pay-scroll {
  overflow: auto;
}
table {
  line-height: 1.15;
}
@media (min-width: 681px) {
  :root {
    --upper-height: clamp(280px, 28vh, 340px);
  }
  table {
    font-size: clamp(11px, 0.85vw, 14px);
  }
}
@media (max-height: 650px) and (min-width: 681px) {
  :root {
    --upper-height: 180px;
  }
  table {
    font-size: 9px;
    line-height: 1.05;
  }
  td,
  th {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Classical printed deck: paper, ink and double-ended court illustrations. */
.card-face {
  background: #fff;
  color: #151515;
  border-color: #dedbd2;
  box-shadow: inset 0 0 0 2px #fff;
}
.card-face.red {
  color: #c7001e;
}
.corner {
  font-family: Arial, sans-serif;
  font-weight: 500;
}
.pips {
  font-family: Arial, sans-serif;
}
.classic-court {
  left: 17%;
  top: 7%;
  width: 66%;
  height: 86%;
  border: 1px solid #232323;
  overflow: hidden;
  background: #fff;
}
.court-half {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: #fff;
}
.court-half.lower {
  top: 50%;
  transform: rotate(180deg);
}
.classic-court .court-half img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 200%;
  object-fit: fill;
  inset: auto;
}
.joker-face .corner {
  color: #151515;
}
.joker-index small {
  font: 600 6px Arial;
  letter-spacing: 0.1px;
}
.joker-face .classic-court {
  border: 0;
  left: 18%;
  width: 64%;
}
@media (max-width: 680px) {
  .classic-court {
    left: 20%;
    width: 60%;
    height: 86%;
    top: 7%;
  }
  .joker-index small {
    font-size: 4px;
  }
}

.classic-court .court-half img {
  inset: 0 auto auto 0;
}
.classic-court {
  left: 13%;
  width: 74%;
}
.joker-face .classic-court {
  left: 16%;
  width: 68%;
}
@media (max-width: 680px) {
  .classic-court {
    left: 20%;
    width: 60%;
  }
}

/* Jumbo indices and pips for readable classic cards. */
.corner {
  left: 6%;
  top: 4%;
  line-height: 0.9;
  font-size: clamp(28px, calc(var(--card-height, 250px)*0.16), 55px);
  font-weight: 500;
}
.corner small {
  font-size: 0.84em;
  line-height: 1;
  margin-top: 4px;
}
.corner.reverse {
  left: auto;
  top: auto;
  right: 6%;
  bottom: 4%;
}
.pips {
  font-size: clamp(26px, calc(var(--card-height, 250px)*0.18), 62px);
}
.pips.ace {
  font-size: clamp(76px, calc(var(--card-height, 250px)*0.48), 164px);
}
.card-face:has(.classic-court) .corner {
  background: #fff;
  padding: 0 2px;
}
.classic-court {
  left: 17%;
  width: 66%;
}
.joker-index small {
  font-size: 7px;
  line-height: 1;
}
.joker-face .corner {
  font-size: clamp(28px, calc(var(--card-height, 250px)*0.16), 55px);
}
@media (max-width: 680px) {
  .corner,
  .joker-face .corner {
    font-size: 24px;
    left: 5%;
    top: 4%;
  }
  .corner.reverse {
    left: auto;
    top: auto;
    right: 5%;
    bottom: 4%;
  }
  .corner small {
    font-size: 19px;
    margin-top: 2px;
  }
  .pips {
    font-size: 22px;
    inset: 23% 16%;
  }
  .pips.ace {
    font-size: 54px;
  }
  .classic-court {
    left: 21%;
    width: 58%;
  }
  .joker-index small {
    font-size: 5px;
  }
}

.pips {
  line-height: 1;
}
@media (min-width: 681px) {
  .pips {
    left: 14%;
    right: 14%;
  }
}

@media (max-width: 680px) {
  .corner,
  .joker-face .corner {
    font-size: 22px;
  }
  .corner small {
    font-size: 17px;
  }
  .pips {
    font-size: 19px;
  }
  .pips.ace {
    font-size: 50px;
  }
  .joker-index small {
    font-size: 5px;
  }
}

/* Card ink scales with its own face, keeping both corners clear. */
.ink-card {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.ink-index {
  font:
    500 56px Arial,
    sans-serif;
}

/* Larger touch controls; reserve vertical space beneath the cards. */
.console {
  min-height: 144px;
  padding: 18px 24px;
}
.console .display {
  min-width: 100px;
}
.console .bet-control {
  min-width: 176px;
}
.console .bet-control > div {
  gap: 14px;
}
.console .bet-control > div > button {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.console .primary,
.console .secondary {
  min-height: 84px;
}
.console .primary {
  min-width: 220px;
  font-size: 14px;
}
.console .primary > span {
  font-size: 11px;
}
@media (min-width: 1101px) {
  .table-shell {
    --card-height: clamp(
      140px,
      calc(100svh - var(--top-height) - var(--upper-height) - 340px),
      340px
    );
  }
}
@media (min-width: 681px) and (max-width: 1100px) {
  .console {
    display: grid;
    grid-template-columns: 1fr 176px 1fr;
  }
  .console .risk-actions {
    grid-column: 1 / 3;
  }
  .console .primary {
    grid-column: 3;
    min-width: 0;
  }
  .console .secondary {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 680px) {
  .console {
    grid-template-columns: 1fr 148px 1fr;
    padding: 16px 12px;
    gap: 14px 8px;
  }
  .console .display,
  .console .bet-control {
    min-width: 0;
  }
  .console .bet-control > div {
    gap: 4px;
  }
  .console .bet-control > div > button {
    width: 44px;
    height: 48px;
  }
  .console .primary {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .console .risk-actions {
    grid-column: 1 / -1;
    gap: 12px;
  }
  .console .secondary {
    min-width: 0;
    flex: 1;
  }
}

/* Keep the complete printed illustration, including both crowns and hands. */
.classic-court .court-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 5% 3%;
  object-fit: contain;
}
.console .small-link {
  font-size: 10px;
  min-height: 44px;
  margin-top: 2px;
}
.console .secondary {
  font-size: 12px;
}
.console .secondary small {
  font-size: 11px;
}
.classic-court {
  left: 13%;
  width: 74%;
}
.classic-court .court-art {
  object-fit: fill;
  padding: 4% 3%;
}
.joker-face .classic-court .court-art {
  object-fit: contain;
}
@media (max-width: 680px) {
  .classic-court {
    left: 17%;
    width: 66%;
  }
}
@media (min-width: 1101px) and (min-height: 651px) {
  :root {
    --upper-height: clamp(230px, 26vh, 310px);
  }
}
@media (min-width: 1101px) and (min-height: 651px) and (max-height: 1000px) {
  .pay-panel table {
    font-size: 11.5px;
    line-height: 1.1;
  }
  .pay-panel td,
  .pay-panel th {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Keep the selected stake and its entire payout visible on compact screens. */
@media (max-width:1100px),(max-height:560px){
 #paytable th[data-chip]:not(.active),#paytable td[data-chip]:not(.active){display:none}
 #paytable{width:100%;min-width:0;table-layout:auto}
 #paytable td.active,#paytable th.active{white-space:nowrap;font-variant-numeric:tabular-nums}
 #paytable td:first-child,#paytable th:first-child{width:auto}
}

/* Winning hands expose all three native actions in separate touch targets. */
@media (max-width: 800px) and (orientation: portrait) {
  html[data-largo-game='joker-poker'] .console #risk-actions:not([hidden]) {
    display: contents;
  }
  html[data-largo-game='joker-poker'] .console #risk-actions > button {
    grid-row: 2;
    width: 100%;
    height: 49px;
    min-height: 44px;
    padding: 3px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
  }
  html[data-largo-game='joker-poker'] .console #half { grid-column: 1; }
  html[data-largo-game='joker-poker'] .console #full { grid-column: 2; }
  html[data-largo-game='joker-poker'] .console #risk-actions small {
    margin-top: 2px;
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0;
  }
  html[data-largo-game='joker-poker'] .console:has(#risk-actions:not([hidden])) > #action {
    grid-column: 3;
    white-space: normal;
    overflow-wrap: anywhere;
    width: 100%;
    min-width: 0;
    height: 49px;
    padding: 3px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
  }
  html[data-largo-game='joker-poker'] .console:has(#risk-actions:not([hidden])) > #action > span {
    margin-top: 2px;
    font-size: 8px;
    line-height: 1;
  }
}

/* 2026-10-26: mobile Joker — payout panel and host above the cards. */
@media (max-width: 800px) and (orientation: portrait) {
  html[data-largo-game='joker-poker'] .table-shell {
    grid-template-rows: clamp(155px, 27dvh, 230px) 30px minmax(150px, 1fr) 134px 14px !important;
  }
  html[data-largo-game='joker-poker'] .pay-panel,
  html[data-largo-game='joker-poker'] .upper .host {
    grid-row: 1 !important;
  }
  html[data-largo-game='joker-poker'] .message-row {
    grid-row: 2 !important;
  }
  html[data-largo-game='joker-poker'] .felt {
    grid-row: 3 !important;
  }
  /* Five equal, proportional risk cards use the full inner width of the felt.
     The small VS track separates the dealer; the four choices span four tracks. */
  html[data-largo-game='joker-poker'] .gamble-row {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    grid-template-columns: minmax(0, 1fr) 12px repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
    align-items: end !important;
  }
  html[data-largo-game='joker-poker'] .gamble-row .dealer-box {
    grid-column: 1;
  }
  html[data-largo-game='joker-poker'] .gamble-row .risk-divider {
    grid-column: 2;
    align-self: center;
    text-align: center;
    font-size: 10px;
  }
  html[data-largo-game='joker-poker'] .gamble-row .choices-box {
    grid-column: 3 / -1;
  }
  html[data-largo-game='joker-poker'] .gamble-row .dealer-box,
  html[data-largo-game='joker-poker'] .gamble-row .choices-box {
    gap: 6px !important;
    min-width: 0;
  }
  html[data-largo-game='joker-poker'] .gamble-row .choices {
    gap: 4px !important;
  }
  html[data-largo-game='joker-poker'] .gamble-row .playing-card {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    aspect-ratio: 2 / 3 !important;
  }
  html[data-largo-game='joker-poker'] .gamble-row .dealer-box > span,
  html[data-largo-game='joker-poker'] .gamble-row .choices-box > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    font-size: 7px;
    line-height: 1.15;
    letter-spacing: 0;
  }
}
