:root {
  color-scheme: dark;
  --ink: #f9f3ef;
  --muted: #bdafc2;
  --gold: #fbd18d;
  --card-width: clamp(43px, 12vw, 63px);
  --card-height: calc(var(--card-width) * 1.38);
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 0;
  margin: 0;
  background: radial-gradient(ellipse at 50% 24%, #24132f, #100b19 65%);
  color: var(--ink);
  min-height: 100svh;
}
button, a { -webkit-tap-highlight-color: transparent; }
button {
  font: inherit;
  color: inherit;
  min-height: 44px;
  padding: 8px 14px;
  background: #241a2e;
  border: 1px solid #6c4c73;
  border-radius: 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: #facaf2; }
button:focus-visible, a:focus-visible { outline: 3px solid #ffebad; outline-offset: 3px; }
button:disabled { opacity: .46; cursor: default; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 59px;
  max-width: 1200px;
  margin: auto;
  padding: 8px clamp(14px, 4vw, 42px);
  position: relative;
  z-index: 2;
  border-bottom: 1px solid #bc83bd39;
  background: #120d1de8;
}
.brand {
  color: #fff5fc;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -.06em;
  text-decoration: none;
}
.brand span { color: #ffa9e9; margin-right: 3px; }
.wallet { text-align: right; }
.wallet span { display: block; color: var(--muted); font-size: 11px; }
.wallet strong { color: var(--gold); font-size: 19px; font-variant-numeric: tabular-nums; }
main { max-width: 1200px; margin: auto; }
.table { position: relative; overflow: hidden; }
.dealer-scene {
  position: relative;
  isolation: isolate;
  height: clamp(245px, 33vw, 370px);
  background: radial-gradient(ellipse at center, #482440, #160b21);
}
.dealer-photo {
  display: block;
  width: min(100%, 775px);
  height: 100%;
  position: absolute;
  inset: 0 auto auto 50%;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: 50% 17%;
  mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
}
.dealer-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #10091de8, #120a20a0 26%, transparent 46% 70%, #13091d72),
    linear-gradient(0deg, #0d191b 0%, transparent 18%);
  pointer-events: none;
}
.text-button {
  min-height: 38px;
  padding: .45rem .7rem;
  font-size: 13px;
  font-weight: 650;
  background: #161020c9;
}
.text-button { color: #f6e3f5; }

.felt {
  position: relative;
  isolation: isolate;
  text-align: center;
  padding: 20px 14px 11px;
  margin-top: -22px;
  min-height: 264px;
}
.felt::before {
  content: "";
  position: absolute;
  z-index: -2;
  pointer-events: none;
  left: 50%;
  top: 0;
  bottom: -40px;
  width: 121%;
  border-radius: 48% 48% 10% 10% / 24% 24% 2% 2%;
  transform: translateX(-50%);
  background:
    repeating-linear-gradient(43deg,#cef5ec0b 0 1px,transparent 1px 4px),
    repeating-linear-gradient(142deg,#050f110f 0 1px,transparent 1px 3px),
    radial-gradient(ellipse at 50% 16%, #237a71, #124341 63%, #0d282d);
  border-top: 3px solid #efb285;
  box-shadow: inset 0 4px 0 #997659, inset 0 8px 32px #08191aa0, 0 -12px 40px #050510b5;
}
.felt::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: 11%;
  left: 16%;
  right: 16%;
  bottom: 1%;
  border: 1px solid #d9f0b33b;
  border-bottom: none;
  border-radius: 50% 50% 15% 15% / 42% 42% 0 0;
}
.hand { position: relative; }
.hand-label {
  display: inline-block;
  color: #ffdebb;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 800;
  text-shadow: 0 1px 3px #071a16;
}
.score {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 21px;
  padding: 0 4px;
  margin-left: 7px;
  border: 1px solid #ccedcf7d;
  color: #fff6df;
  background: #102d2a;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 720;
}
.cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1vw, 9px);
  height: var(--card-height);
  margin: 6px auto 0;
  max-width: min(88%, 720px);
}
#upper-cards { --card-width: clamp(39px, 10vw, 54px); }
.card-slot, .playing-card {
  flex: 0 1 var(--card-width);
  min-width: 17px;
  height: var(--card-height);
  border-radius: 7px;
}
.card-slot { background: #0b33324d; border: 1px solid #e1ddd07a; box-shadow: 0 0 0 3px #042b2b21; }
.playing-card {
  color: #101b23;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg,#fffdf6,#efe4e4);
  border: 1px solid #fffdef;
  box-shadow: 0 4px 8px #051b19b0;
  font-family: Georgia, serif;
}
.playing-card.in-flight { z-index: 3; }
.playing-card.red { color: #a82244; }
.playing-card .corner { position: absolute; top: 3px; left: 5px; font-size: 14px; font-weight: bold; }
.playing-card .inverted { inset: auto 5px 3px auto; transform: rotate(180deg); }
.playing-card .suit { font-size: clamp(22px, 6vw, 36px); }
.playing-card.face-down, .shoe-back {
  color: #ffb9e9;
  border: 3px solid #f1dfed;
  outline: 1px solid #ffb5eb7d;
  outline-offset: -6px;
  background: repeating-linear-gradient(42deg,#ff8ae523 0 1px,transparent 1px 5px),
    repeating-linear-gradient(-42deg,#ffb3e32b 0 1px,transparent 1px 5px), #47234d;
}
.playing-card.face-down { font-size: 22px; }
.shoe {
  position: absolute;
  inset: 22px clamp(21px, 13vw, 154px) auto auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  transform: rotate(13deg);
}
.shoe-back {
  display: grid;
  place-items: center;
  width: clamp(32px, 9vw, 42px);
  height: clamp(44px, 12vw, 57px);
  font: 19px Georgia, serif;
  border-radius: 5px;
  box-shadow: 2px 2px #5e2b53, 4px 4px #efc2de, 6px 6px #654261, 0 9px 16px #031b1988;
}
.shoe.is-dealing .shoe-back { border-color: #ffd2ef; }
.shoe-label { color: #f6d5e9; font-size: 9px; font-weight: 700; text-shadow: 0 1px 4px #051814; }
.table-divider {
  width: min(48%, 360px);
  height: 8px;
  margin: 9px auto 7px;
  border-top: 1px solid #e6cf8f6a;
  border-radius: 50%;
}
.round-result { position: relative; min-height: 44px; margin-top: 12px; }
.message { margin: 0; font-size: 14px; color: #fff2d5; font-weight: 750; }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 25px;
  flex-wrap: wrap;
  position: relative;
  padding: 12px 10px max(16px,env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 0%, #4d342b 0%, transparent 72%),
    linear-gradient(180deg, #2b1e1d, #1a1316 55%, #130f14);
  border-top: 1px solid #8c643e;
  box-shadow: inset 0 2px #ffe4ad1c, inset 0 5px #100c0b52, 0 -10px 24px #100c10a0;
}
.actions { display: flex; align-items: center; gap: 8px; }
.bet-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 190px);
  align-items: center;
  gap: 3px 10px;
}
.bet-label {
  color: #f2d4ae;
  font-size: 12px;
  font-weight: 700;
}
.bet-stepper {
  display: grid;
  grid-template-columns: 46px minmax(64px, 1fr) 46px;
  align-items: center;
  gap: 3px;
  background: #100c0f;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px #000b, 0 0 0 1px #ae835366;
}
.bet-stepper button {
  padding: 0;
  height: 46px;
  color: #ffdfa8;
  background: linear-gradient(#5b3c29, #34231c);
  border-color: #b28b5a;
  border-radius: 13px;
  box-shadow: inset 0 1px #fff1c72b;
  font-size: 23px;
  font-weight: 750;
}
.bet-stepper input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #ffe1a9;
  caret-color: #ffe1a9;
  text-align: center;
  font: 800 19px system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.bet-stepper input:focus-visible { outline: 2px solid #ffebad; outline-offset: 2px; }
.bet-limits { grid-column: 2; margin: 0; text-align: center; color: #c9ad96; font-size: 11px; }
#reset { font-size: 13px; }
.main-action {
  min-height: 47px;
  padding-inline: 18px;
  color: #2e1b10;
  background: linear-gradient(180deg, #ffebbc 0%, #e9bb72 55%, #d19a54 100%);
  border-color: #ffe2a8;
  font-weight: 850;
  box-shadow: inset 0 1px #fff7db, 0 2px #775025, 0 4px 12px #0006;
}
.actions button:not(.main-action) {
  color: #f8dfbb;
  background: linear-gradient(#463329, #2b201c);
  border-color: #8e694a;
  box-shadow: inset 0 1px #fff1c71a;
}
.controls button:hover:not(:disabled) { border-color: #ffe7b1; }
.controls button:active:not(:disabled) { transform: translateY(1px); }
.double-hint { flex-basis: 100%; text-align: center; font-size: 12px; line-height: 1.5; margin: -2px 0 0; color: #cfb8a3; }
dialog {
  background: #24182e;
  color: var(--ink);
  width: min(460px,calc(100% - 32px));
  padding: 24px;
  border: 1px solid #b47dae;
  border-radius: 14px;
}
dialog h2 { margin: 0 0 10px; }
dialog::backdrop { background: #0b070ebd; }
dialog p { line-height: 1.55; }
.close { float: right; font-size: 24px; padding: 0 10px; }

@media (max-width: 620px) {
  .topbar { min-height: 53px; }
  .brand { font-size: 21px; }
  .dealer-scene { height: clamp(218px, 62vw, 310px); }
  .dealer-photo { object-position: center 25%; mask-image: none; }
  .dealer-scene::after { background: linear-gradient(0deg,#0b181c 0%,transparent 12% 71%,#130a20da 100%); }
  .text-button { font-size: 12px; min-height: 36px; padding: 6px 9px; }
  .felt { margin-top: clamp(-54px, -13vw, -40px); padding-top: 17px; }
  .shoe { inset: 22px 14px auto auto; }
  .felt::after { left: 10%; right: 10%; }
  .round-result { margin-top: 10px; }
  .controls { gap: 9px 15px; }
  .actions button { padding-inline: 10px; font-size: 14px; }
  .bet-panel { justify-content: center; }
}
@media (max-width: 375px) {
  #deal { white-space: nowrap; }
  .controls { padding-inline: 8px; }
  .actions { gap: 6px; }
}

/* The dealer sits beyond the far rail. The arc and spots are printed on the felt. */
.felt { padding-bottom: 23px; }
.felt::before {
  bottom: 3px;
  border-radius: 48% 48% 45% 45% / 22% 22% 5% 5%;
  background:
    repeating-linear-gradient(43deg, #ddf4d80c 0 1px, transparent 1px 4px),
    repeating-linear-gradient(142deg, #04191316 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 17%, #287654, #154d37 58%, #0c2d27);
  border-top-color: #bb9963;
  border-bottom: 4px solid #15100d;
  box-shadow: inset 0 4px 0 #86683e, inset 0 8px 26px #0b271fa0, 0 -8px 25px #05090f9e;
}
.felt::after {
  top: 14%;
  left: 9%;
  right: 9%;
  bottom: 7%;
  border: 1px solid #d1c6875c;
  border-width: 1px 1px 0;
  border-radius: 50% 50% 37% 37% / 36% 36% 18% 18%;
}
.table-divider {
  height: auto;
  min-height: 23px;
  padding-top: 6px;
  width: min(68%, 420px);
  border-color: #edd79b75;
  color: #e8d79f;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.player-seats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(6px, 2vw, 20px);
  max-width: 680px;
  margin: 0 auto;
}
.player-seats.split-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-seats .cards { max-width: 100%; }
.split-seats .player-seat.active-hand {
  border-color: #edd69b;
  background: radial-gradient(ellipse at 50% 100%, #e9d68521, transparent 70%);
}
.split-seats .active-hand .hand-label { color: #fff2c4; }
.hand-result { margin: 7px 0 0; min-height: 14px; font-size: 11px; color: #f0dfb1; font-weight: 650; }
.shoe-back {
  border-color: #ad9e82;
  background: repeating-linear-gradient(45deg, #edce842c 0 1px, transparent 1px 5px), #242722;
  color: #f2d899;
  outline-color: #ebcf8d70;
  box-shadow: 2px 3px #151814, 4px 6px #988568, 6px 9px #151814, 0 9px 20px #031612b0;
}
.actions { flex-wrap: wrap; justify-content: center; }
@media (max-width: 420px) {
  .split-seats .player-seat { --card-width: clamp(32px, 9.7vw, 43px); }
  .split-seats .cards { gap: 3px; }
  .split-seats .playing-card .corner { left: 3px; font-size: 11px; }
  .split-seats .playing-card .inverted { inset: auto 3px 3px auto; }
  .split-seats .playing-card .suit { font-size: 22px; }
  .split-seats .hand-result { font-size: 10px; }
  .actions { gap: 4px; }
  .actions button { padding-inline: 8px; font-size: 13px; }
}

.topbar-tools { display: flex; align-items: center; gap: 11px; }
body {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  width: 100%;
  max-width: none;
  flex: none;
  padding-top: max(7px, env(safe-area-inset-top));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
main {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.table {
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}
.dealer-scene { flex: 1 0 104px; height: auto; }
.felt { flex: none; }
.hand { line-height: 21px; }
.hand-label, .score { vertical-align: top; }
.player-seat, .split-seats .player-seat {
  padding: 4px 4px 6px;
  border-bottom: 1px solid transparent;
}
.hand-result { margin-top: 3px; line-height: 15px; }
.hand-result[hidden] { display: block !important; visibility: hidden; min-height: 15px; }
.round-result { display: grid; align-items: center; height: 36px; min-height: 0; }
.controls {
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  grid-template-rows: 65px 28px;
  gap: 2px 25px;
}
.actions { min-width: 0; }
.double-hint {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 14px;
}
@media (max-width: 620px) {
  .controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 65px 47px 28px;
    gap: 2px;
  }
  .actions button { padding-inline: 8px; font-size: 13px; }
}
.expanded-table main { max-width: none; }
.expanded-table .dealer-photo { width: min(100%, 970px); }
@media (max-width: 620px), (orientation: portrait) and (max-height: 870px) {
  .dealer-photo { object-position: center 19%; }
  .felt { padding-bottom: 17px; }
  .round-result { margin-top: 7px; }
  .controls { padding-top: 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (orientation: portrait) and (max-height: 675px) {
  :root { --card-width: clamp(35px, 10vw, 49px); }
  #upper-cards { --card-width: clamp(32px, 9vw, 42px); }
  .felt { padding-bottom: 12px; }
  .table-divider { min-height: 17px; margin: 6px auto 4px; padding-top: 4px; }
  .bet-stepper button, .bet-stepper input { height: 44px; }
}
@media (orientation: portrait) and (max-height: 600px) {
  .dealer-scene { flex-basis: 80px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  :root { --card-width: clamp(34px, 9dvh, 46px); }
  .topbar { min-height: 51px; }
  .table { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .dealer-scene { height: auto; min-height: 0; }
  .dealer-photo, .expanded-table .dealer-photo { width: 100%; object-position: center 24%; mask-image: none; }
  .dealer-scene::after { background: linear-gradient(90deg,#110b1d26 50%,#110b1de8), linear-gradient(0deg,#080514b0,transparent 28%); }
  .felt { min-height: 0; margin-top: 0; padding: 10px 6px 5px; align-self: stretch; }
  .felt::before { border-radius: 44% 44% 30% 30% / 8% 8% 4% 4%; }
  #upper-cards { --card-width: clamp(29px, 8dvh, 40px); --card-height: calc(var(--card-width) * 1.38); }
  .table-divider { min-height: 16px; padding-top: 3px; margin: 6px auto 4px; }
  .round-result { height: 28px; margin-top: 4px; }
  .shoe { inset: 14px 12px auto auto; }
  .shoe-back { width: 30px; height: 40px; }
  .controls {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    grid-template-rows: 62px 28px;
    gap: 2px 12px;
    padding: 4px 8px max(4px, env(safe-area-inset-bottom));
  }
  .actions { gap: 4px; }
  .actions button { padding-inline: 7px; font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 400px) {
  :root { --card-width: clamp(29px, 8dvh, 35px); }
  .topbar { padding-top: max(3px, env(safe-area-inset-top)); padding-bottom: 3px; }
  .felt { padding-top: 4px; }
  .hand { line-height: 19px; }
  .score { height: 19px; }
  .cards { margin-top: 4px; }
  .table-divider { min-height: 12px; margin-block: 4px 3px; }
  .round-result { height: 23px; }
  .round-result .message { font-size: 13px; }
}
@media (min-width: 621px) and (min-height: 521px) and (max-height: 770px) {
  :root { --card-width: 53px; }
  .felt { padding-bottom: 16px; }
}
@media (orientation: landscape) and (max-height: 345px) {
  :root { --card-width: 26px; }
  #upper-cards { --card-width: 26px; }
  .controls { grid-template-rows: 62px 14px; }
  .table-divider { margin-block: 2px; }

}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.topbar { background: #100e16; }
.toolbar-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #534656;
  border-radius: 13px;
  color: #f6eff7;
  background: #1a1620;
  font-size: 22px;
  cursor: pointer;
}
.toolbar-button[aria-pressed="true"] { color: #ffda98; border-color: #ab804e; }
.toolbar-button:focus-visible { outline: 2px solid #ffe4ad; outline-offset: 2px; }
.table-menu { position: relative; }
.table-menu summary::-webkit-details-marker { display: none; }
.menu-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 4px;
  padding: 5px;
  background: #17131c;
  border: 1px solid #574256;
  border-radius: 13px;
  box-shadow: 0 8px 24px #000a;
}
.menu-options button { text-align: left; white-space: nowrap; font-size: 13px; }

.dealer-call {
  position: absolute;
  z-index: 1;
  top: 9%;
  left: 9%;
  margin: 0;
  padding: 7px 13px;
  border-radius: 18px;
  background: #fff9f2;
  color: #19141b;
  font-size: clamp(11px, 2.8vw, 18px);
  font-weight: 750;
}
.dealer-call::after {
  position: absolute;
  right: 10px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  background: inherit;
  transform: skew(24deg) rotate(35deg);
  content: "";
}
.felt::before {
  border-bottom: 7px solid #6c452c;
  box-shadow: inset 0 -2px #d1a773, inset 0 -5px #362419, inset 0 5px 24px #0b271fa0, 0 3px #aa7947, 0 9px 14px #090604;
}
.table-divider {
  display: grid;
  justify-items: center;
  width: min(69%, 390px);
  margin: 0 auto 7px;
  padding: 0 0 4px;
  border-top: 0;
  border-bottom: 1px solid #cfab6a9c;
  color: #efd399;
  font: 700 clamp(9px, 2.3vw, 15px)/1.22 Georgia, serif;
  letter-spacing: .08em;
}
.score {
  border-color: #ae8a50;
  background: #1a1511;
  color: #ffe3aa;
}
.score.natural {
  background: #12462c;
  color: #fff2c0;
  border-color: #f8d68c;
  box-shadow: 0 0 14px #f6c55b94;
}
.playing-card {
  color: #141012;
  background: linear-gradient(135deg, #fffdf4, #ede7d9);
  border-color: #d9ccba;
}
.playing-card.face-down {
  color: #f1c071;
  border: 2px solid #eed7a5;
  background:
    repeating-linear-gradient(45deg, #f7bc6926 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, #f7bc6926 0 1px, transparent 1px 7px),
    linear-gradient(125deg, #683329, #342017);
}
.court-card .suit {
  display: grid;
  place-items: center;
  width: 52%;
  height: 58%;
  border-block: 1px solid #be9454;
  color: inherit;
  background: linear-gradient(38deg, #c69b5344, transparent 46%, #c69b5344);
}

.controls {
  grid-template-columns: minmax(0, max-content) minmax(0, max-content);
  grid-template-rows: 47px 48px 23px;
  gap: 2px 18px;
  padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 0%, #281d1c, transparent 76%), #110e15;
}
.chip-tray {
  display: grid;
  grid-template-columns: repeat(5, clamp(35px, 9.3vw, 45px)) repeat(2, minmax(0, auto));
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1vw, 9px);
}
.chip-tray .chip {
  --chip-edge: #353231;
  --chip-center: #222120;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #ffffff45;
  border-radius: 50%;
  color: #fff9ef;
  background:
    radial-gradient(circle, var(--chip-center) 0 49%, #fff8e998 50% 53%, var(--chip-edge) 54% 64%, transparent 65%),
    repeating-conic-gradient(#f8e6d4 0deg 12deg, var(--chip-edge) 12deg 60deg);
  box-shadow: inset 0 1px #fff8e966, 0 2px #0009;
  font-size: clamp(10px, 2.9vw, 13px);
  font-weight: 800;
}
.chip[data-chip="500"] { --chip-edge: #b45b28; --chip-center: #803b17; }
.chip[data-chip="1000"] { --chip-edge: #79368f; --chip-center: #51236e; }
.chip[data-chip="5000"] { --chip-edge: #27805e; --chip-center: #17583e; }
.chip[data-chip="25000"] { --chip-edge: #a33948; --chip-center: #681f2a; }
.chip-tray .tray-action {
  min-width: 0;
  min-height: 35px;
  padding: 3px clamp(4px, 1vw, 11px);
  border-color: #5c4a51;
  background: #19151c;
  font-size: clamp(10px, 2.7vw, 13px);
  white-space: nowrap;
}
.bet-panel {
  grid-template-columns: auto minmax(0, 137px) auto;
  justify-content: center;
  gap: 3px 6px;
}
.bet-stepper { grid-template-columns: 34px minmax(46px, 1fr) 34px; }
.bet-stepper button, .bet-stepper input { min-height: 36px; height: 36px; }
.bet-stepper input { padding-inline: 1px; font-size: 15px; }
.bet-limits { grid-column: 3; max-width: 68px; font-size: 10px; }
.actions {
  grid-column: 1 / -1;
  width: min(100%, 660px);
  justify-self: center;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
}
.actions button { padding: 5px 2px; font-size: clamp(12px, 3.5vw, 16px); }
.actions .main-action { min-height: 46px; }
.actions .main-action:disabled {
  opacity: 1;
  color: #a38c77;
  background: linear-gradient(#3d2d26, #251c1a);
  border-color: #664931;
  box-shadow: inset 0 1px #fff1c71a;
}

@media (max-width: 640px) and (orientation: portrait) {
  .controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 39px 47px 24px;
  }
  .dealer-photo { object-position: center 28%; }
  .dealer-call { left: 5%; }
  .felt { margin-top: -24px; padding-top: 10px; }
  .felt::before { bottom: 5px; }
}
@media (max-width: 380px) {
  .topbar-tools { gap: 6px; }
  .chip-tray { gap: 3px; }
  .round-result { height: 28px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .controls { grid-template-rows: 40px 46px 15px; gap: 2px 12px; }
  .chip-tray { grid-template-columns: repeat(5, 35px) repeat(2, minmax(0, auto)); gap: 4px; }
  .bet-limits { display: none; }
  .bet-panel { grid-template-columns: auto minmax(0, 130px); }
  .felt { margin-top: 0; }
  .table-divider { margin-bottom: 3px; padding-bottom: 2px; }
  .round-result { height: 23px; }
}
@media (orientation: landscape) and (max-height: 345px) {
  .controls { grid-template-rows: 38px 46px 14px; padding-block: 3px max(3px, env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 400px) {
  .dealer-call { display: none; }
  .table-divider {
    position: absolute;
    right: calc(100% + 8px);
    bottom: 9px;
    width: 70%;
    margin: 0;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    background: #120d1de8;
  }
  .round-result {
    position: absolute;
    top: 6px;
    right: calc(100% + 8px);
    width: 70%;
    height: auto;
    min-height: 23px;
    margin: 0;
    padding: 3px 7px;
    border-radius: 8px;
    background: #120d1de8;
  }
}
@media (orientation: portrait) and (min-height: 680px) {
  .table-divider { font-size: clamp(11px, 2.9vw, 16px); }
}
.chip-tray .chip:disabled { opacity: .66; }
