:root {
  --bg: #070908;
  --bg-soft: #0b0e0c;
  --panel: #0e1210;
  --ink: #f3f0e6;
  --ink-dim: #c9c5b9;
  --muted: #8b8d84;
  --line: rgba(243, 240, 230, 0.12);
  --line-strong: rgba(243, 240, 230, 0.22);
  --gold: #d8b77c;
  --gold-dim: rgba(216, 183, 124, 0.16);
  --win: #86d9ae;
  --loss: #e39a92;
  --danger: #c96057;
  --card: #f8f5ea;
  --top-h: 62px;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", ui-sans-serif, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: #14120c;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(255, 255, 255, 0.045), transparent 60%),
    var(--bg);
}

.app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: repeating-linear-gradient(115deg, #fff 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--top-h);
  flex: 0 0 var(--top-h);
  padding: 0 clamp(14px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 8, 0.82);
  backdrop-filter: blur(18px);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn.is-off {
  opacity: 0.5;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.1;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand span {
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.wallet {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 14px;
  margin-right: 2px;
  border-right: 1px solid var(--line);
  line-height: 1.15;
}

.wallet span {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.wallet strong {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.wallet strong.flash-win {
  color: var(--win);
}

.wallet strong.flash-loss {
  color: var(--loss);
}

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* ---------- Lobby ---------- */

.lobby {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vh, 58px) clamp(16px, 4vw, 30px) 70px;
  animation: fade-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lobby-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.display {
  margin: 14px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6.4vw, 58px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.display em {
  font-style: italic;
  color: var(--gold);
}

.lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 14px;
}

.lobby-record {
  display: flex;
  gap: 22px;
  padding-bottom: 4px;
}

.lobby-record div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lobby-record span {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.lobby-record strong {
  font-size: 19px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.reload-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(201, 96, 87, 0.4);
  border-radius: 14px;
  background: rgba(201, 96, 87, 0.08);
}

.reload-banner strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.reload-banner span {
  font-size: 12.5px;
  color: var(--ink-dim);
}

.table-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
}

.table-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.table-row:not(.locked):hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.table-row.locked {
  opacity: 0.6;
}

.table-row.locked:hover {
  opacity: 0.8;
}

.swatch {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.16), transparent 58%),
    var(--tone, #14372c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13), 0 8px 18px rgba(0, 0, 0, 0.32);
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.table-info {
  min-width: 0;
}

.table-info strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.table-info small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.table-meta strong {
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-meta small {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table-row.unlocked .table-meta small {
  color: var(--win);
}

.table-row.locked .table-meta small {
  color: var(--gold);
}

.table-row.needs-balance .table-meta small {
  color: var(--loss);
}

.table-row.needs-balance .unlock-track i {
  background: var(--loss);
}

.lock-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  justify-self: end;
}

.table-row.unlocked .lock-icon {
  color: var(--ink-dim);
}

.unlock-track {
  grid-column: 2 / -1;
  position: relative;
  height: 2px;
  margin-top: -3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.unlock-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lobby-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.link-btn {
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.link-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

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

.foot-note b {
  color: var(--ink-dim);
  font-weight: 500;
}

/* ---------- Table ---------- */

.table-screen {
  --card-h: clamp(96px, 20vh, 172px);
  --card-w: calc(var(--card-h) * 0.69);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.table-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}

.table-screen.fx-win::after {
  background: radial-gradient(ellipse at 50% 62%, rgba(216, 183, 124, 0.3), transparent 62%);
  animation: fx-fade 1.5s ease-out both;
}

.table-screen.fx-loss::after {
  background: radial-gradient(ellipse at 50% 58%, transparent 38%, rgba(122, 26, 26, 0.38) 100%);
  animation: fx-fade 1.2s ease-out both;
}

@keyframes fx-fade {
  0% { opacity: 0; }
  16% { opacity: 1; }
  100% { opacity: 0; }
}

.felt {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px clamp(10px, 3vw, 34px) 0;
  overflow: hidden;
  background:
    radial-gradient(95% 80% at 50% 32%, var(--tone, #14372c) 0%, rgba(7, 10, 8, 0.9) 68%, #060807 100%);
  animation: felt-in 0.5s ease both;
}

.felt::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -64%;
  width: 130%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.014), 0 0 0 110px rgba(255, 255, 255, 0.008);
  pointer-events: none;
}

.felt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 44% at 50% 52%, var(--glow, transparent), transparent 74%);
  pointer-events: none;
  opacity: 0.8;
}

.felt-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243, 240, 230, 0.5);
}

.shoe {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.shoe-bar {
  width: 54px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.shoe-bar i {
  display: block;
  height: 100%;
  background: rgba(243, 240, 230, 0.5);
  transition: width 0.4s ease;
}

.shoe strong {
  color: rgba(243, 240, 230, 0.8);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.limits {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dealer-zone,
.player-zone {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dealer-zone {
  padding-top: clamp(2px, 2vh, 18px);
}

.zone-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 22px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(243, 240, 230, 0.48);
}

.peek-tag {
  padding: 1px 6px;
  border: 1px solid rgba(216, 183, 124, 0.45);
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 8.5px;
  letter-spacing: 0.16em;
}

.total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 21px;
  padding: 0 8px;
  border: 1px solid rgba(243, 240, 230, 0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.24);
  transition: color 0.2s, border-color 0.2s;
}

.total-badge.soft {
  color: var(--gold);
  border-color: rgba(216, 183, 124, 0.45);
}

.total-badge.bust {
  color: var(--loss);
  border-color: rgba(227, 154, 146, 0.5);
}

.total-badge.blackjack {
  color: #17130a;
  background: var(--gold);
  border-color: var(--gold);
}

.cards {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--card-h) + 4px);
}

.dealer-cards {
  padding-bottom: 2px;
}

.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  flex: 0 0 auto;
  border-radius: 8px;
  perspective: 700px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.32));
}

.card + .card {
  margin-left: 5px;
}

.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card.is-down .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-front {
  color: #1b1a16;
  background:
    linear-gradient(150deg, #fdfaf1 0%, #f3eee0 58%, #e9e3d3 100%);
  box-shadow: inset 0 0 0 1px rgba(27, 26, 22, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.card-front.red {
  color: #b03930;
}

.card-back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, rgba(216, 183, 124, 0.14) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(216, 183, 124, 0.14) 0 1px, transparent 1px 7px),
    linear-gradient(145deg, #143a2f, #0b201a);
  box-shadow: inset 0 0 0 1px rgba(216, 183, 124, 0.38), inset 0 0 0 4px #0e2a22;
}

.card-back::after {
  content: "V";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: calc(var(--card-h) * 0.25);
  color: rgba(216, 183, 124, 0.55);
  border: 1px solid rgba(216, 183, 124, 0.2);
  margin: 9px;
  border-radius: 3px;
}

.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.9;
}

.corner.tl {
  top: calc(var(--card-h) * 0.06);
  left: calc(var(--card-h) * 0.07);
}

.corner.br {
  bottom: calc(var(--card-h) * 0.06);
  right: calc(var(--card-h) * 0.07);
  transform: rotate(180deg);
}

.corner b {
  font-size: calc(var(--card-h) * 0.145);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.corner i {
  font-style: normal;
  font-size: calc(var(--card-h) * 0.11);
  opacity: 0.9;
}

.card-front.red .corner i,
.card-front.red .pip {
  color: #b03930;
}

.pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: calc(var(--card-h) * 0.4);
  opacity: 0.9;
}

.card.enter {
  animation: deal 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--d, 0ms);
}

.card.flip-in .card-inner {
  animation: flip-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 7px 9px 5px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: border-color 0.25s, background 0.25s;
}

.hand.active {
  border-color: rgba(216, 183, 124, 0.38);
  background: rgba(216, 183, 124, 0.055);
}

.hand .cards {
  min-height: calc(var(--card-h) + 2px);
}

.hand[data-cards="4"] .card + .card {
  margin-left: calc(var(--card-w) * -0.18);
}

.hand[data-cards="5"] .card + .card {
  margin-left: calc(var(--card-w) * -0.24);
}

.hand[data-cards="6"] .card + .card,
.hand[data-cards="7"] .card + .card {
  margin-left: calc(var(--card-w) * -0.3);
}

.hand[data-cards="8"] .card + .card {
  margin-left: calc(var(--card-w) * -0.38);
}

.hand[data-cards="9"] .card + .card {
  margin-left: calc(var(--card-w) * -0.34);
}

.hand[data-cards="10"] .card + .card {
  margin-left: calc(var(--card-w) * -0.5);
}

.hand[data-cards="8"],
.hand[data-cards="9"],
.hand[data-cards="10"] {
  --card-h: clamp(64px, 10.5vh, 94px);
  --card-w: calc(var(--card-h) * 0.69);
}

.hand[data-cards="11"] .card + .card,
.hand[data-cards="12"] .card + .card {
  margin-left: calc(var(--card-w) * -0.44);
}

.hand[data-cards="11"],
.hand[data-cards="12"] {
  --card-h: clamp(56px, 9vh, 80px);
  --card-w: calc(var(--card-h) * 0.69);
}

.dealer-cards[data-count="4"] .card + .card {
  margin-left: calc(var(--card-w) * -0.14);
}

.dealer-cards[data-count="5"] .card + .card {
  margin-left: calc(var(--card-w) * -0.2);
}

.dealer-cards[data-count="6"] .card + .card {
  margin-left: calc(var(--card-w) * -0.34);
}

.dealer-cards[data-count="7"] .card + .card {
  margin-left: calc(var(--card-w) * -0.34);
}

.dealer-cards[data-count="7"],
.dealer-cards[data-count="8"] {
  --card-h: clamp(84px, 13.5vh, 116px);
  --card-w: calc(var(--card-h) * 0.69);
}

.dealer-cards[data-count="8"] .card + .card {
  margin-left: calc(var(--card-w) * -0.44);
}

.dealer-cards[data-count="9"] .card + .card {
  margin-left: calc(var(--card-w) * -0.44);
}

.dealer-cards[data-count="10"] .card + .card {
  margin-left: calc(var(--card-w) * -0.5);
}

.dealer-cards[data-count="9"],
.dealer-cards[data-count="10"] {
  --card-h: clamp(72px, 11.5vh, 100px);
  --card-w: calc(var(--card-h) * 0.69);
}

.dealer-cards[data-count="11"] .card + .card,
.dealer-cards[data-count="12"] .card + .card {
  margin-left: calc(var(--card-w) * -0.5);
}

.dealer-cards[data-count="11"],
.dealer-cards[data-count="12"] {
  --card-h: clamp(64px, 10vh, 88px);
  --card-w: calc(var(--card-h) * 0.69);
}

.hand-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
}

.hand-bet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(243, 240, 230, 0.8);
  background: rgba(0, 0, 0, 0.28);
}

.mini-chip {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  background: #2a6150;
  box-shadow: inset 0 0 0 2px #143a2f;
}

.hand-result {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.hand-result.win,
.hand-result.blackjack {
  color: var(--win);
}

.hand-result.lose,
.hand-result.bust {
  color: var(--loss);
}

.hand-result.push,
.hand-result.surrender {
  color: var(--muted);
}

.hands {
  --card-w: calc(var(--card-h) * 0.69);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 1.4vw, 16px);
  max-width: 100%;
  padding: 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.hands::-webkit-scrollbar {
  display: none;
}

.hands[data-count="3"] {
  --card-h: clamp(84px, 16vh, 132px);
}

.hands[data-count="4"] {
  --card-h: clamp(76px, 14vh, 112px);
}

.hands[data-count="3"] .hand {
  padding-inline: 6px;
}

.hands[data-count="4"] .hand {
  padding-inline: 4px;
}

.center-msg {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 4px 0;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 9, 7, 0.46);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: var(--ink-dim);
  animation: fade-up 0.25s ease both;
}

.status-pill strong {
  color: var(--ink);
  font-weight: 600;
}

.status-pill.win {
  border-color: rgba(134, 217, 174, 0.4);
  color: var(--win);
}

.status-pill.win strong {
  color: var(--win);
}

.status-pill.loss {
  border-color: rgba(227, 154, 146, 0.4);
  color: var(--loss);
}

.status-pill.loss strong {
  color: var(--loss);
}

.status-pill.gold {
  border-color: rgba(216, 183, 124, 0.4);
  color: var(--gold);
}

.status-pill.gold strong {
  color: var(--gold);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}

.player-zone {
  padding-bottom: clamp(4px, 1.6vh, 14px);
}

.betting-spot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 2px 12px;
  border: 1px dashed rgba(216, 183, 124, 0.4);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.2);
}

.betting-spot strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.betting-spot.empty {
  opacity: 0.55;
}

/* ---------- Dock ---------- */

.dock {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  padding: 12px clamp(12px, 3vw, 28px) calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 11, 9, 0.72), #080b09 55%);
  backdrop-filter: blur(20px);
}

.dock-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 6px;
}


.side-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  white-space: nowrap;
}

.side-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.side-toggle.has-bets {
  border-color: rgba(216, 183, 124, 0.45);
  color: var(--gold);
  background: var(--gold-dim);
}

.side-toggle b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bet-read {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  margin-right: 2px;
}

.bet-read span {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.bet-read strong {
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.bet-read strong.empty {
  color: var(--muted);
}

.dock-links {
  display: flex;
  gap: 4px;
}

.text-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
}

.text-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.text-btn.accent {
  color: var(--gold);
}

.text-btn.accent:hover {
  color: var(--gold);
  background: var(--gold-dim);
}

.dock-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chip-rack {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1vw, 9px);
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.chip-rack::-webkit-scrollbar {
  display: none;
}

.chip {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(42px, 5.8vw, 50px);
  height: clamp(42px, 5.8vw, 50px);
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, opacity 0.2s;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 0 4px rgba(0, 0, 0, 0.16),
    inset 0 0 0 5px rgba(255, 255, 255, 0.14);
}

.chip::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

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

.chip:not(:disabled):active {
  transform: scale(0.92);
}

.chip:disabled {
  opacity: 0.28;
}

.chip-1 {
  background: radial-gradient(circle at 35% 30%, #f2ede0, #cfc7b4 70%);
  color: #22201a;
  text-shadow: none;
  border-color: rgba(0, 0, 0, 0.22);
}

.chip-5 {
  background: radial-gradient(circle at 35% 30%, #d4655c, #8f2b25 72%);
}

.chip-25 {
  background: radial-gradient(circle at 35% 30%, #3f8d6b, #18503a 72%);
}

.chip-100 {
  background: radial-gradient(circle at 35% 30%, #3d4046, #15171a 72%);
}

.chip-500 {
  background: radial-gradient(circle at 35% 30%, #86689f, #3f2a55 72%);
}

.chip-1000 {
  background: radial-gradient(circle at 35% 30%, #d8b77c, #8b6730 72%);
  color: #1b1409;
  text-shadow: none;
}

.chip-5000 {
  background: radial-gradient(circle at 35% 30%, #62a6b8, #255262 72%);
}

.chip-25000 {
  background: radial-gradient(circle at 35% 30%, #e3cda6, #a37a3c 72%);
  color: #1b1409;
  text-shadow: none;
}

.chip-100000 {
  background: radial-gradient(circle at 35% 30%, #6573f2, #2a2f78 72%);
}

.deal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 clamp(18px, 3vw, 30px);
  margin-left: auto;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--gold);
  color: #17130a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.18s, transform 0.15s, opacity 0.2s;
  box-shadow: 0 10px 24px rgba(216, 183, 124, 0.16);
}

.deal-btn:not(:disabled):hover {
  background: #e6c88f;
  transform: translateY(-1px);
}

.deal-btn:active {
  transform: translateY(0) scale(0.99);
}

.deal-btn:disabled {
  opacity: 0.3;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 92px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  transition: background 0.16s, border-color 0.16s, opacity 0.2s, transform 0.14s;
}

.action-btn small {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.action-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.34);
}

.action-btn:not(:disabled):active {
  transform: scale(0.98);
}

.action-btn:disabled {
  opacity: 0.26;
}

.action-btn.primary {
  background: var(--ink);
  color: #14130e;
  border-color: var(--ink);
}

.action-btn.primary small {
  color: rgba(20, 19, 14, 0.55);
}

.action-btn.primary:not(:disabled):hover {
  background: #fffdf5;
}

.action-btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #17130a;
}

.action-btn.gold small {
  color: rgba(23, 19, 10, 0.55);
}

.action-btn.gold:not(:disabled):hover {
  background: #e7cb96;
  border-color: #e7cb96;
}

.action-btn.ghost {
  border-color: var(--line);
  color: var(--ink-dim);
}

.dock-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.insurance-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 4px;
  animation: fade-up 0.3s ease both;
}

.insurance-copy {
  min-width: 0;
  margin-right: auto;
}

.insurance-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.insurance-copy span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.insurance-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.insurance-actions .action-btn {
  min-width: 112px;
}

.broke-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 6px 2px;
  animation: fade-up 0.3s ease both;
}

.broke-copy {
  min-width: 0;
  margin-right: auto;
}

.broke-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.broke-copy span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.broke-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dealer-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  color: var(--ink-dim);
  font-size: 12.5px;
}

.setup-zone {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0;
}

.side-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(430px, 84vw);
}

.side-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 11, 9, 0.5);
  transition: border-color 0.2s, background 0.2s;
}

.side-tile.active {
  border-color: rgba(216, 183, 124, 0.5);
  background: rgba(216, 183, 124, 0.09);
}

.side-tile-name {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-tile-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.side-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.side-field {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.16s, background 0.16s;
}

.side-field:focus-within {
  border-color: rgba(216, 183, 124, 0.55);
  background: rgba(0, 0, 0, 0.32);
}

.side-amount-cur {
  flex: 0 0 auto;
  font-size: 9.5px;
  color: var(--muted);
}

.side-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}

.side-input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.side-tile .side-input {
  height: 100%;
}

.side-tile-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.side-tile-controls button {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s, transform 0.12s;
}

.side-tile-controls button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
}

.side-tile-controls button:not(:disabled):active {
  transform: scale(0.96);
}

.side-tile-controls button:disabled {
  opacity: 0.24;
}

.side-strip-live {
  width: min(440px, 86vw);
  margin: 0 auto;
}

.side-strip-live .side-tile {
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
}

.side-tile.live {
  padding: 7px 10px;
}

.side-tile.live .side-tile-note {
  grid-column: 1 / -1;
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-tile.live.win {
  border-color: rgba(134, 217, 174, 0.55);
  background: rgba(134, 217, 174, 0.09);
  animation: side-win 0.8s ease both;
}

.side-tile.live.win .side-tile-value {
  color: var(--win);
}

.side-tile.live.loss {
  opacity: 0.62;
}

.side-tile.live.loss .side-tile-value {
  color: var(--loss);
}

.side-tile.live.pending {
  border-style: dashed;
  border-color: rgba(216, 183, 124, 0.4);
}

.side-tile.live.pending .side-tile-value {
  color: var(--gold);
}

.bet-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: clamp(148px, 21vw, 196px);
  aspect-ratio: 1;
  border: 1px dashed rgba(216, 183, 124, 0.32);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 183, 124, 0.055), transparent 70%);
  transition: border-color 0.3s, background 0.3s;
}

.bet-circle.has-bet {
  border-color: rgba(216, 183, 124, 0.62);
  background: radial-gradient(circle, rgba(216, 183, 124, 0.13), transparent 70%);
}

.bet-circle span {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.bet-circle strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.bet-circle small {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.setup-side {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hand-index {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hand.active .hand-index {
  color: var(--gold);
}

.settle-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  min-height: 50px;
}

.result-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
}

.result-copy span {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-copy strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result-copy strong.win {
  color: var(--win);
}

.result-copy strong.loss {
  color: var(--loss);
}

.result-detail {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.settle-line .action-btn {
  margin-left: auto;
  min-width: 138px;
}

.settle-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.settle-actions .action-btn {
  margin-left: 0;
  min-width: 0;
}

.text-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.icon-btn:disabled {
  opacity: 0.28;
}

.thinking {
  display: inline-flex;
  gap: 4px;
}

.thinking i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 1.1s infinite;
}

.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- Sheet ---------- */

.sheet-root[hidden] {
  display: none;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 4, 4, 0.66);
  backdrop-filter: blur(6px);
  animation: fade-in 0.24s ease both;
}

.sheet {
  position: fixed;
  z-index: 81;
  left: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86dvh, 760px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #0c100d;
  box-shadow: var(--shadow);
  animation: sheet-up 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet-grab {
  width: 38px;
  height: 3px;
  margin: 9px auto 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sheet-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 17px;
  transition: color 0.18s, border-color 0.18s;
}

.sheet-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.sheet-body {
  overflow-y: auto;
  padding: 18px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* Side bets */

.side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-row {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.2s, background 0.2s;
}

.side-row.has-bet {
  border-color: rgba(216, 183, 124, 0.35);
  background: rgba(216, 183, 124, 0.045);
}

.side-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-name {
  min-width: 0;
  margin-right: auto;
}

.side-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.side-name span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.stepper button {
  width: 34px;
  height: 100%;
  font-size: 16px;
  color: var(--ink-dim);
  transition: background 0.15s, color 0.15s;
}

.stepper button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.stepper button:disabled {
  opacity: 0.25;
}

.stepper-field {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 100%;
  min-width: 68px;
  padding: 0 5px;
  border-inline: 1px solid var(--line);
  transition: background 0.15s;
}

.stepper-field:focus-within {
  background: rgba(216, 183, 124, 0.1);
}

.stepper-field span {
  flex: 0 0 auto;
  font-size: 9.5px;
  color: var(--muted);
}

.stepper-field .side-input {
  width: 52px;
  font-size: 12px;
  text-align: right;
}

.side-hint {
  margin-top: 9px;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(139, 141, 132, 0.85);
}

.side-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.side-total {
  font-size: 12px;
  color: var(--muted);
}

.side-total strong {
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.side-foot .deal-btn {
  height: 42px;
  margin-left: auto;
}

/* Leaderboard */

.lb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.lb-toolbar .chip-note {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lb-toolbar .text-btn {
  margin-left: auto;
}

.lb-identity {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.lb-identity input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s;
}

.lb-identity input::placeholder {
  color: rgba(139, 141, 132, 0.7);
}

.lb-identity input:focus {
  border-color: rgba(216, 183, 124, 0.55);
}

.lb-identity button {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--gold);
  color: #17130a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lb-identity button:disabled {
  opacity: 0.4;
}

.lb-code {
  margin: -10px 0 8px;
}

.lb-code input {
  height: 36px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lb-code button {
  height: 36px;
  background: transparent;
  color: var(--gold);
  border-color: rgba(216, 183, 124, 0.45);
}

.lb-code-note {
  margin: 0 0 16px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.lb-note {
  margin-bottom: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.lb-note.good {
  color: var(--win);
}

.lb-note.bad {
  color: var(--loss);
}

.lb-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(216, 183, 124, 0.3);
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--gold);
  background: rgba(216, 183, 124, 0.06);
}

.lb-list {
  display: flex;
  flex-direction: column;
}

.lb-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid rgba(243, 240, 230, 0.07);
}

.lb-row:last-child {
  border-bottom: 0;
}

.lb-row.me {
  padding-inline: 10px;
  border-radius: 8px;
  background: rgba(216, 183, 124, 0.08);
}

.lb-rank {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lb-row:nth-child(1) .lb-rank,
.lb-row:nth-child(2) .lb-rank,
.lb-row:nth-child(3) .lb-rank {
  color: var(--gold);
  font-weight: 600;
}

.lb-name {
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-name .you {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border: 1px solid rgba(216, 183, 124, 0.4);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  vertical-align: 2px;
}

.lb-peak {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-empty {
  padding: 34px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.lb-skeleton {
  height: 38px;
  margin-bottom: 2px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.lb-meta {
  margin-top: 16px;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(139, 141, 132, 0.8);
}

.lb-identity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.lb-identity-card .lb-who {
  min-width: 0;
  margin-right: auto;
}

.lb-identity-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-identity-card span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
}

.lb-identity-card .action-btn {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
}

.lb-identity-card .text-btn {
  flex: 0 0 auto;
  color: var(--gold);
}

.lb-identity-card.guest {
  border-color: rgba(216, 183, 124, 0.28);
  background: rgba(216, 183, 124, 0.05);
}

/* Account */

.account-btn.is-on {
  color: var(--gold);
  border-color: rgba(216, 183, 124, 0.45);
  background: var(--gold-dim);
}

.account-head {
  margin-bottom: 14px;
}

.account-head h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.account-head p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.account-form {
  display: grid;
  gap: 10px;
}

.account-field {
  display: grid;
  gap: 6px;
}

.account-field span {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.account-field input:focus {
  border-color: rgba(216, 183, 124, 0.55);
  background: rgba(0, 0, 0, 0.35);
}

.account-form .action-btn {
  margin-top: 4px;
}

.account-form .text-btn {
  justify-self: center;
  font-size: 11.5px;
  color: var(--gold);
}

.account-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.account-switch .text-btn {
  color: var(--gold);
  font-size: 11.5px;
}

.account-note {
  margin-top: 14px;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(139, 141, 132, 0.85);
}

.account-alert {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.45;
}

.account-alert.bad {
  border: 1px solid rgba(214, 106, 96, 0.35);
  background: rgba(214, 106, 96, 0.08);
  color: #eba49c;
}

.account-alert.good {
  border: 1px solid rgba(116, 183, 132, 0.32);
  background: rgba(116, 183, 132, 0.08);
  color: #9fd6ac;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(216, 183, 124, 0.45);
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.account-who {
  min-width: 0;
  margin-right: auto;
}

.account-who strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-who span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-pill {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sync-pill.ok {
  border-color: rgba(116, 183, 132, 0.35);
  background: rgba(116, 183, 132, 0.07);
  color: #9fd6ac;
}

.sync-pill.saving {
  border-color: rgba(216, 183, 124, 0.35);
  background: var(--gold-dim);
  color: var(--gold);
}

.sync-pill.error {
  border-color: rgba(214, 106, 96, 0.35);
  background: rgba(214, 106, 96, 0.08);
  color: #eba49c;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.account-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.account-stats span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.account-actions .action-btn {
  flex: 1;
}

.account-actions .text-btn.danger {
  color: var(--loss);
}

/* Rules */

.rules-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.rules-section:first-child {
  padding-top: 0;
}

.rules-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rules-section h3 {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.rules-section p {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-dim);
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  margin-top: 10px;
}

.rule-grid div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(243, 240, 230, 0.06);
  font-size: 11.5px;
  color: var(--muted);
}

.rule-grid b {
  font-weight: 500;
  color: var(--ink-dim);
  text-align: right;
}

.rule-steps {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}

.rule-steps li::marker {
  color: var(--gold);
  font-size: 11px;
}

.rule-list {
  display: grid;
  gap: 11px;
  margin-top: 10px;
}

.rule-list div {
  display: grid;
  gap: 3px;
}

.rule-list strong {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.rule-list span {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.rule-alert {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(216, 183, 124, 0.35);
  border-radius: 10px;
  background: var(--gold-dim);
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.6;
}

.side-rule {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(243, 240, 230, 0.06);
}

.side-rule h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.side-rule p {
  margin-top: 4px;
}

.rule-note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.paytable {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.paytable div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.paytable b {
  color: var(--ink-dim);
  font-weight: 500;
  text-align: right;
}

/* Reload */

.reload-card {
  text-align: center;
  padding: 6px 0 2px;
}

.reload-amount {
  margin: 12px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--gold);
}

.reload-card p {
  max-width: 38ch;
  margin: 0 auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.reload-card .action-btn {
  margin-top: 20px;
  min-width: 210px;
  height: 48px;
  background: var(--gold);
  border-color: var(--gold);
  color: #17130a;
}

.reload-card small {
  display: block;
  margin-top: 12px;
  font-size: 10.5px;
  color: rgba(139, 141, 132, 0.8);
}

/* Stats */

.stats-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.stats-hero > div {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.stats-hero span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-hero strong {
  display: block;
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--gold);
}

.stats-hero > div:last-child strong {
  color: var(--ink);
}

.stats-rate {
  margin-top: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stats-rate-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-rate-head b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.stats-bar {
  height: 5px;
  margin-top: 10px;
  border-radius: 99px;
  background: rgba(243, 240, 230, 0.08);
  overflow: hidden;
}

.stats-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(216, 183, 124, 0.45), var(--gold));
}

.stats-rate small {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.stat-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.stat-cell span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-cell strong {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}

.stats-note {
  margin-top: 13px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.stats-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
}

.stats-foot b {
  margin-left: 4px;
  font-weight: 500;
  color: var(--ink-dim);
}

.stats-foot span:last-child b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
}

/* Reset account */

.link-btn.danger {
  color: rgba(227, 154, 146, 0.85);
}

.link-btn.danger:hover {
  color: var(--loss);
  border-color: rgba(227, 154, 146, 0.5);
}

.action-btn.danger {
  background: var(--loss);
  border-color: var(--loss);
  color: #1b0f0e;
}

.action-btn.danger:not(:disabled):hover {
  background: #efb0a9;
  border-color: #efb0a9;
}

.reset-card {
  text-align: center;
  padding: 4px 0 2px;
}

.reset-card > p {
  max-width: 40ch;
  margin: 0 auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.reset-list {
  display: grid;
  gap: 9px;
  max-width: 360px;
  margin: 18px auto 0;
  padding: 14px 18px;
  list-style: none;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.reset-list li {
  position: relative;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-dim);
}

.reset-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--loss);
  opacity: 0.8;
}

.reset-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.reset-actions .action-btn {
  flex: 1 1 0;
  max-width: 180px;
}

.reset-card > p.reset-warning {
  color: var(--loss);
}

.reset-code {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.reset-code b {
  display: inline-block;
  margin-left: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.reset-note {
  display: block;
  margin-top: 12px;
  font-size: 10.5px;
  color: rgba(139, 141, 132, 0.8);
}

/* Mod menu */

.link-btn.mod {
  color: var(--gold);
}

.mod-code {
  display: grid;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
}

.mod-code p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.mod-code input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-align: center;
}

.mod-code input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.mod-card {
  display: grid;
  gap: 12px;
}

.mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mod-badge {
  padding: 4px 9px;
  border: 1px solid rgba(216, 183, 124, 0.45);
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.mod-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.mod-field {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mod-field span {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mod-field input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mod-field input:focus {
  outline: none;
}

.mod-row .action-btn {
  flex: 0 0 auto;
  height: auto;
}

.mod-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mod-quick .text-btn {
  flex: 1 1 0;
  min-width: 96px;
  height: 36px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-dim);
}

.mod-quick .text-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.mod-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.mod-section {
  display: grid;
  gap: 8px;
}

.mod-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mod-toggle strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.mod-toggle span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}

.mod-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.18s, border-color 0.18s;
}

.mod-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s, background 0.18s;
}

.mod-switch.on {
  border-color: rgba(216, 183, 124, 0.6);
  background: var(--gold-dim);
}

.mod-switch.on i {
  transform: translateX(18px);
  background: var(--gold);
}

.mod-card > .action-btn {
  justify-self: start;
}

/* Toast */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(16, 21, 18, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  color: var(--ink);
  text-align: center;
  animation: toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.toast.gold {
  border-color: rgba(216, 183, 124, 0.45);
  color: var(--gold);
}

/* ---------- Responsive ---------- */

@media (min-width: 720px) {
  .sheet {
    top: 50%;
    bottom: auto;
    border-bottom: 1px solid var(--line);
    border-radius: 22px;
    transform: translate(-50%, -50%);
    animation: sheet-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .sheet-grab {
    display: none;
  }

  .sheet-head {
    padding-top: 22px;
  }
}

/* Split hands: 3 or 4 hands wrap in a 2-column grid on narrow screens */

@media (max-width: 900px) {
  .hands[data-count="3"],
  .hands[data-count="4"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
    align-items: end;
    gap: 8px 4px;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 0;
    overflow: visible;
  }

  .hands[data-count="3"] .hand:last-child {
    grid-column: 1 / -1;
  }

  .hands[data-count="3"] .hand,
  .hands[data-count="4"] .hand {
    width: 100%;
    padding-inline: 2px;
  }
}

@media (max-width: 680px) {
  :root {
    --top-h: 58px;
  }

  .brand strong {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand {
    overflow: hidden;
  }

  .brand span {
    font-size: 8.5px;
  }

  .wallet {
    padding-right: 10px;
    margin-right: 0;
  }

  .wallet strong {
    font-size: 15px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .topbar {
    gap: 10px;
  }

  .top-actions {
    gap: 7px;
  }

  .lobby-record {
    gap: 18px;
  }

  .lobby-record strong {
    font-size: 16px;
  }

  .table-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px 14px;
  }

  .swatch {
    width: 38px;
    height: 38px;
  }

  .swatch::after {
    inset: 9px;
  }

  .table-info strong {
    font-size: 17px;
  }

  .table-meta strong {
    font-size: 12px;
  }

  .table-meta small {
    font-size: 8.5px;
  }

  .lock-icon {
    display: none;
  }

  .unlock-track {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .table-screen {
    --card-h: clamp(92px, 15.5vh, 132px);
  }

  .hands[data-count="2"] {
    --card-h: clamp(56px, 9.5vh, 78px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="4"] {
    --card-h: clamp(52px, 8.5vh, 70px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="4"] .card + .card {
    margin-left: calc(var(--card-w) * -0.2);
  }

  .hands[data-count="2"] .hand[data-cards="5"] {
    --card-h: clamp(48px, 7.5vh, 62px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="5"] .card + .card {
    margin-left: calc(var(--card-w) * -0.3);
  }

  .hands[data-count="2"] .hand[data-cards="6"] {
    --card-h: clamp(42px, 7vh, 58px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="6"] .card + .card {
    margin-left: calc(var(--card-w) * -0.36);
  }

  .hands[data-count="2"] .hand[data-cards="7"] {
    --card-h: clamp(40px, 6.75vh, 54px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="7"] .card + .card {
    margin-left: calc(var(--card-w) * -0.44);
  }

  .hands[data-count="2"] .hand[data-cards="8"],
  .hands[data-count="2"] .hand[data-cards="9"],
  .hands[data-count="2"] .hand[data-cards="10"],
  .hands[data-count="2"] .hand[data-cards="11"],
  .hands[data-count="2"] .hand[data-cards="12"] {
    --card-h: clamp(38px, 6.25vh, 52px);
    --card-w: calc(var(--card-h) * 0.69);
  }

  .hands[data-count="2"] .hand[data-cards="8"] .card + .card {
    margin-left: calc(var(--card-w) * -0.5);
  }

  .hands[data-count="2"] .hand[data-cards="9"] .card + .card {
    margin-left: calc(var(--card-w) * -0.54);
  }

  .hands[data-count="2"] .hand[data-cards="10"] .card + .card,
  .hands[data-count="2"] .hand[data-cards="11"] .card + .card,
  .hands[data-count="2"] .hand[data-cards="12"] .card + .card {
    margin-left: calc(var(--card-w) * -0.56);
  }

  .hands[data-count="3"] {
    --card-h: clamp(56px, 9vh, 78px);
  }

  .hands[data-count="4"] {
    --card-h: clamp(50px, 8vh, 70px);
  }

  .felt {
    padding-top: 9px;
  }

  .zone-label {
    font-size: 8.5px;
  }

  .table-screen .card + .card {
    margin-left: 3px;
  }

  .hand {
    padding: 5px 5px 3px;
    gap: 5px;
  }

  .hand .cards {
    gap: 0;
  }

  .hand[data-cards="4"] .card + .card {
    margin-left: calc(var(--card-w) * -0.2);
  }

  .hand[data-cards="5"] .card + .card {
    margin-left: calc(var(--card-w) * -0.28);
  }

  .hand[data-cards="6"] .card + .card {
    margin-left: calc(var(--card-w) * -0.38);
  }

  .hand[data-cards="7"] .card + .card,
  .hand[data-cards="8"] .card + .card,
  .hand[data-cards="9"] .card + .card {
    margin-left: calc(var(--card-w) * -0.44);
  }

  .status-pill {
    font-size: 11px;
    padding: 6px 11px;
    max-width: 92vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .center-msg {
    min-height: 38px;
  }

  .side-strip {
    gap: 6px;
    width: min(360px, 92vw);
  }

  .side-tile {
    padding: 6px 7px;
    border-radius: 10px;
  }

  .side-tile-name {
    font-size: 7.5px;
  }

  .side-tile-value {
    font-size: 12.5px;
  }

  .side-input {
    font-size: 16px;
  }

  .side-field {
    height: 26px;
    padding: 0 5px;
  }

  .side-tile-controls {
    gap: 3px;
  }

  .side-tile-controls button {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .side-strip-live {
    width: min(360px, 92vw);
  }

  .side-tile.live .side-tile-note {
    font-size: 8px;
  }

  .dock {
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .dock-inner {
    gap: 8px;
  }

  .side-toggle {
    height: 30px;
    font-size: 10px;
    padding: 0 10px;
  }

  .bet-read strong {
    font-size: 17px;
  }

  .dock-links .text-btn {
    padding: 0 7px;
  }

  .dock-top {
    row-gap: 6px;
  }

  .dock-links {
    margin-left: auto;
  }

  .dock-bottom {
    gap: 8px;
  }

  .chip {
    width: 40px;
    height: 40px;
    font-size: 10.5px;
  }

  .deal-btn {
    height: 44px;
    padding: 0 16px;
    font-size: 10.5px;
    letter-spacing: 0.1em;
  }

  .action-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0 8px;
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .action-btn small {
    display: none;
  }

  .actions {
    gap: 6px;
  }

  .insurance-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 0;
  }

  .insurance-copy {
    text-align: center;
  }

  .insurance-actions {
    justify-content: center;
  }

  .insurance-actions .action-btn {
    flex: 1 1 0;
  }

  .broke-panel {
    gap: 10px;
  }

  .broke-actions {
    width: 100%;
  }

  .broke-actions .action-btn {
    flex: 1;
  }

  .sheet-head h2 {
    font-size: 22px;
  }

  .sheet-body {
    padding-inline: 17px;
  }

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

  .side-row {
    padding: 11px;
  }

  .stepper-field {
    min-width: 78px;
  }

  .stepper-field .side-input {
    width: 58px;
    font-size: 16px;
  }

  .lb-identity input {
    font-size: 16px;
  }

  .settle-line {
    gap: 8px 12px;
  }

  .result-detail {
    order: 3;
    flex-basis: 100%;
  }

  .settle-line .action-btn {
    min-width: 118px;
    height: 44px;
  }

  .settle-actions {
    width: 100%;
    gap: 6px;
  }

  .settle-actions .action-btn {
    flex: 1;
    min-width: 0;
  }

  .toast-root {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 560px) and (max-width: 680px) {
  .table-screen {
    --card-h: clamp(56px, 14vh, 84px);
  }

  .hands[data-count="2"] {
    --card-h: clamp(52px, 13vh, 80px);
  }

  .hands[data-count="3"] {
    --card-h: clamp(44px, 10vh, 64px);
  }

  .hands[data-count="4"] {
    --card-h: clamp(38px, 8.5vh, 56px);
  }

  .felt {
    padding-top: 6px;
  }

  .zone-label {
    min-height: 18px;
  }

  .center-msg {
    min-height: 30px;
  }

  .player-zone {
    padding-bottom: 4px;
  }

  .hand {
    padding-top: 4px;
    padding-bottom: 2px;
    gap: 4px;
  }
}

@media (max-height: 640px) and (min-width: 681px) {
  .table-screen {
    --card-h: clamp(62px, 12vh, 88px);
  }

  .felt {
    padding-top: 6px;
  }

  .center-msg {
    min-height: 34px;
  }

  .dock {
    padding-top: 8px;
    padding-bottom: 8px;
  }

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

  .deal-btn,
  .action-btn {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes deal {
  0% {
    opacity: 0;
    transform: translate(54px, -74px) rotate(7deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
}

@keyframes flip-in {
  0% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(0);
  }
}

@keyframes side-win {
  0% { transform: scale(0.94); box-shadow: 0 0 0 0 rgba(134, 217, 174, 0.5); }
  55% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(134, 217, 174, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(134, 217, 174, 0); }
}

@keyframes stamp-in {
  from { opacity: 0; transform: scale(0.72) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bust-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

@keyframes spark-fly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); }
}

@keyframes felt-win {
  0% { box-shadow: inset 0 0 0 rgba(216, 183, 124, 0); }
  35% { box-shadow: inset 0 0 90px rgba(216, 183, 124, 0.2); }
  100% { box-shadow: inset 0 0 0 rgba(216, 183, 124, 0); }
}

.flying-chip {
  position: fixed;
  z-index: 120;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  background: #d8b77c;
  color: #17130a;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.spark {
  position: fixed;
  z-index: 110;
  width: var(--size, 4px);
  height: var(--size, 4px);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(216, 183, 124, 0.85);
  pointer-events: none;
  animation: spark-fly 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
}

.result-copy strong {
  animation: stamp-in 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: left center;
}

.fx-chip {
  position: fixed;
  z-index: 130;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  background: radial-gradient(circle at 32% 28%, #f3dcab, #d8b76c 58%, #99762f);
  color: #241a06;
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.fx-chip.gold {
  background: radial-gradient(circle at 32% 28%, #fff4d2, #f0cf8a 55%, #b98f3e);
  box-shadow:
    0 0 18px rgba(240, 207, 138, 0.6),
    0 8px 18px rgba(0, 0, 0, 0.45);
}

.hand-result.pop {
  display: inline-block;
  animation: result-pop 0.55s cubic-bezier(0.2, 1.5, 0.35, 1) both;
  animation-delay: var(--delay, 0ms);
}

@keyframes result-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.dealer-zone.bust .cards {
  animation: bust-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.table-screen.is-blackjack .felt {
  animation: felt-win 1.4s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes felt-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes sheet-in {
  from { transform: translate(-50%, calc(-50% + 18px)); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
