:root {
  color-scheme: dark;
  --bg: #090807;
  --panel: #111212;
  --panel-2: #181817;
  --felt: #012118;
  --felt-2: #043022;
  --gold: #c9a554;
  --gold-dim: #8f743d;
  --text: #f3efe5;
  --muted: #b5aa92;
  --green: #62df58;
  --red: #ef4d44;
  --blue: #3185d8;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(199, 156, 76, 0.16), transparent 30rem),
    linear-gradient(135deg, #080807, #17110d 45%, #070706);
  color: var(--text);
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 50% 22%, rgba(232, 184, 97, 0.11), transparent 28rem),
    radial-gradient(circle at 82% 82%, rgba(29, 83, 61, 0.1), transparent 24rem),
    rgba(8, 8, 7, 0.68);
  backdrop-filter: blur(2.5px) saturate(0.96);
}

.login-panel {
  width: min(488px, 100%);
  border: 1px solid rgba(232, 184, 97, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 23, 19, 0.94), rgba(11, 12, 11, 0.96)),
    #10100f;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 246, 213, 0.05);
  padding: clamp(24px, 4vw, 36px);
}

.login-panel h1 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 9vw, 64px);
  line-height: 0.9;
  letter-spacing: 0;
  color: #fff7e7;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid rgba(232, 184, 97, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 6, 5, 0.58);
  box-shadow:
    inset 0 1px 1px rgba(255, 246, 213, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.login-tab,
.auth-submit {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(232, 184, 97, 0.34);
  border-radius: 6px;
  background: rgba(18, 19, 18, 0.86);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.login-tab {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: rgba(243, 239, 229, 0.74);
  border-radius: 5px;
  box-shadow: none;
}

.login-tab svg,
.auth-submit svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.login-tab svg {
  width: 17px;
  height: 17px;
}

.login-tab:not(.active) svg {
  opacity: 0.58;
}

.login-tab.active,
.auth-submit {
  background: linear-gradient(180deg, rgba(52, 45, 15, 0.96), rgba(26, 21, 6, 0.96));
  color: #fff4bd;
  border-color: #d7c21a;
  box-shadow: inset 0 1px 0 rgba(255, 246, 190, 0.08);
}

.login-tab.active {
  border: 1px solid rgba(247, 215, 86, 0.88);
  background:
    linear-gradient(180deg, rgba(75, 64, 20, 0.94), rgba(35, 29, 8, 0.96));
  color: #fff8ce;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 246, 190, 0.12);
}

.login-tab:not(.active):hover {
  color: #fff7e7;
  background: rgba(255, 255, 255, 0.045);
}

.login-tab:hover,
.auth-submit:hover {
  border-color: rgba(247, 215, 86, 0.9);
  box-shadow: 0 0 0 3px rgba(215, 194, 26, 0.08);
}

.login-tab:hover {
  box-shadow: none;
}

.login-tab:active,
.auth-submit:active {
  transform: translateY(1px);
}

.login-tab:focus-visible,
.auth-submit:focus-visible,
.login-form input:focus-visible {
  outline: 2px solid rgba(247, 215, 86, 0.95);
  outline-offset: 3px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  background: rgba(7, 9, 8, 0.72);
  color: var(--text);
  font: inherit;
  padding: 0 14px;
  box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.22);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.login-form input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.login-form input:focus-visible {
  background: rgba(9, 12, 11, 0.92);
  border-color: rgba(247, 215, 86, 0.88);
  box-shadow:
    inset 0 1px 10px rgba(0, 0, 0, 0.22),
    0 0 0 3px rgba(215, 194, 26, 0.08);
}

.auth-submit {
  margin-top: 2px;
}

.login-message {
  min-height: 18px;
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.35;
}

.game-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 17vw) 1fr minmax(260px, 19vw);
  gap: 0;
}

.rail {
  background: linear-gradient(180deg, #111211, #080909);
  border-color: var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.rail-left {
  border-right: 1px solid var(--line);
}

.rail-right {
  border-left: 1px solid var(--line);
}

.brand {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 500;
  letter-spacing: 0;
}

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

.view-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin-top: 12px;
  padding: 5px;
  border: 1px solid rgba(232, 184, 97, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 5, 5, 0.72);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 246, 213, 0.04);
}

.view-switcher:has(.view-switcher-link:nth-of-type(3):not([hidden])) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.view-switcher-link {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: rgba(215, 204, 180, 0.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.view-switcher-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #fff7e7;
}

.view-switcher-link.active {
  border-color: rgba(245, 234, 25, 0.76);
  background:
    linear-gradient(180deg, rgba(65, 54, 16, 0.92), rgba(24, 20, 7, 0.94));
  color: #fff8d8;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 246, 150, 0.12);
}

.view-switcher-link[data-view-link="admin"]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(232, 184, 97, 0.72);
  box-shadow: 0 0 10px rgba(232, 184, 97, 0.22);
}

.view-switcher-link[data-view-link="admin"].active::before {
  background: #62df58;
  box-shadow: 0 0 12px rgba(98, 223, 88, 0.38);
}

.view-switcher-link:active {
  transform: translateY(1px);
}

.view-switcher-link:focus-visible {
  outline: none;
  border-color: rgba(245, 234, 25, 0.9);
  box-shadow:
    0 0 0 3px rgba(245, 234, 25, 0.12),
    inset 0 1px 0 rgba(255, 246, 150, 0.1);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 16px 30px var(--shadow);
  overflow: hidden;
}

.panel-title {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 1px solid var(--line);
}

.bankroll {
  padding: 12px 16px 16px;
  color: var(--green);
  font-size: clamp(25px, 2.2vw, 36px);
  font-variant-numeric: tabular-nums;
}

.overall-bankroll {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 13px;
}

.overall-bankroll strong {
  color: var(--muted);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.overall-bankroll strong.win {
  color: var(--green);
}

.overall-bankroll strong.loss {
  color: var(--red);
}

.overall-bankroll strong.push {
  color: var(--muted);
}

.audio-panel {
  display: block;
  overflow: hidden;
}

.audio-drawer-summary {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.audio-drawer-summary::-webkit-details-marker {
  display: none;
}

.audio-drawer-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

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

.audio-drawer-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.audio-drawer-summary b {
  justify-self: end;
  color: #fff5b8;
  font-size: 12px;
  font-weight: 900;
}

.audio-drawer-body {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toggle-row,
.control-row {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--text);
  font-weight: 700;
}

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

.control-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.toggle-row input {
  width: 42px;
  height: 22px;
  accent-color: var(--gold);
  cursor: pointer;
}

.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

.control-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: #111212;
  color: var(--text);
  font: inherit;
  padding: 0 10px;
}

.control-row select:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.player-profile-controls {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
}

.player-profile-controls label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-profile-controls select,
.player-name-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: #111212;
  color: var(--text);
  font: inherit;
  padding: 0 10px;
}

.player-profile-controls select:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.player-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
}

.player-name-form .ghost-button {
  width: 100%;
  min-height: 38px;
  margin: 0;
}

.bankroll-panel > .ghost-button {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
}

.ghost-button,
.utility-button {
  width: calc(100% - 20px);
  margin: 0 10px 12px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: linear-gradient(180deg, #2a2a28, #171817);
  cursor: pointer;
}

.chip-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 12px;
}

.table-chip-panel {
  position: fixed;
  left: 42%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 6;
  width: min(880px, calc(100% - 56px));
  grid-template-columns: minmax(112px, 1.1fr) minmax(112px, 1.1fr) repeat(4, 62px) repeat(3, minmax(64px, 1fr));
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(10, 10, 9, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

.total-bet-pill,
.round-pnl-pill {
  width: 100%;
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 12px;
  border: 1px solid rgba(201, 165, 84, 0.48);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.total-bet-pill strong,
.round-pnl-pill strong {
  color: #fff5b8;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  white-space: nowrap;
}

.round-pnl-pill strong.win {
  color: #7dff78;
}

.round-pnl-pill strong.loss {
  color: #ff716c;
}

.round-pnl-pill strong.push {
  color: #eee1c7;
}

.table-chip-panel .chip {
  width: 62px;
  max-width: 100%;
  border-width: 5px;
  font-size: 13px;
  display: grid;
  place-items: center;
  gap: 1px;
  line-height: 1;
}

.table-chip-panel .table-utility-button {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 2px;
  line-height: 1;
}

.chip {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  border: 7px dashed rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.38);
  font-weight: 800;
  font-size: clamp(15px, 1.2vw, 22px);
  cursor: pointer;
}

.chip kbd,
.action kbd,
.table-utility-button kbd {
  min-width: 18px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 248, 216, 0.86);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.chip-1 {
  background: #e9e4d8;
  color: #111;
}

.chip-5 {
  background: #b52225;
}

.chip-10 {
  background: #1e68b7;
}

.chip-25 {
  background: #237b48;
}

.chip-100 {
  background: #111;
}

.chip-500 {
  background: #f07820;
}

.chip-1000 {
  background: #b78cff;
  color: #160d28;
}

.chip-10000 {
  background: #3f9f46;
  color: #f3ffe9;
}

.table-wrap {
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px 12px;
}

.table {
  position: relative;
  width: min(100%, 1180px);
  min-height: 720px;
  border: 18px solid #351c10;
  border-radius: 42% / 19%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04), transparent 40%),
    radial-gradient(ellipse at center, var(--felt-2), var(--felt) 68%, #041f10);
  box-shadow:
    inset 0 0 0 5px #1b0f09,
    inset 0 0 80px rgba(0, 0, 0, 0.35),
    0 28px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.table::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 5px);
  pointer-events: none;
}

.countdown-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  color: rgba(255, 246, 208, 0.2);
  font-size: clamp(112px, 22vw, 260px);
  font-weight: 900;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
  user-select: none;
}

.countdown-overlay.result-overlay {
  width: min(420px, 78%);
  min-height: 174px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px 28px;
  border: 2px solid rgba(255, 240, 90, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 38, 18, 0.94), rgba(4, 12, 6, 0.94)),
    radial-gradient(circle at 50% 0, rgba(255, 240, 90, 0.22), transparent 70%);
  color: #fff7b2;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.55),
    0 18px 48px rgba(0, 0, 0, 0.48),
    0 0 28px rgba(255, 240, 90, 0.34);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
}

.countdown-overlay.surrender-overlay {
  width: min(360px, 76%);
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px 26px;
  border: 2px solid rgba(255, 225, 103, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(37, 24, 3, 0.94), rgba(10, 7, 2, 0.94)),
    radial-gradient(circle at 50% 0, rgba(255, 225, 103, 0.2), transparent 70%);
  color: #ffe167;
  font-size: 16px;
  line-height: 1;
  pointer-events: auto;
  text-align: center;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.55),
    0 18px 48px rgba(0, 0, 0, 0.48),
    0 0 28px rgba(255, 225, 103, 0.34);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
}

.result-overlay .result-kicker {
  color: #d8c68a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.surrender-overlay .result-kicker {
  color: #e9cf74;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-overlay strong {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
}

.surrender-overlay strong {
  color: #fff;
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.result-overlay b {
  color: #62df58;
  font-size: clamp(24px, 3.2vw, 38px);
  font-variant-numeric: tabular-nums;
}

.result-overlay.loss b {
  color: #ff716c;
}

.result-overlay.push b {
  color: #eee1c7;
}

.result-overlay small {
  color: #e6d7aa;
  font-size: 13px;
  font-weight: 800;
}

.surrender-overlay small {
  color: #f7e4a2;
  font-size: 13px;
  font-weight: 800;
}

.surrender-decline {
  min-width: 76px;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(247, 228, 162, 0.9);
  border-radius: 999px;
  background: rgba(8, 7, 3, 0.74);
  color: #fff7d0;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.surrender-decline:hover,
.surrender-decline:focus-visible {
  border-color: #fff7d0;
  background: rgba(35, 26, 7, 0.92);
}

.asm {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  width: 260px;
  height: 118px;
  border: 4px solid #0c0c0c;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #242424, #080808);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.asm-title {
  font-size: 26px;
  font-weight: 800;
  color: #cfc7b2;
}

.asm-window {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.asm-window span {
  width: 56px;
  height: 38px;
  border-radius: 3px;
  background:
    linear-gradient(45deg, transparent 46%, rgba(150, 37, 26, 0.9) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(150, 37, 26, 0.9) 46% 54%, transparent 54%),
    #f7e9dd;
  border: 3px solid #1b1713;
}

.asm small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.discard-tray {
  position: absolute;
  top: 86px;
  right: 10%;
  width: 112px;
  height: 100px;
  border: 2px solid rgba(201, 165, 84, 0.55);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.hand-area {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.dealer-area {
  top: 124px;
}

.player-hands {
  position: absolute;
  left: 50%;
  top: 270px;
  transform: translateX(-50%);
  width: min(690px, 86%);
  height: 136px;
  pointer-events: none;
  z-index: 3;
}

.player-hand {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.player-hand.active::before {
  content: "";
  position: absolute;
  left: 13px;
  top: -104px;
  width: 90px;
  height: 168px;
  border: 2px solid #30d7ff;
  border-radius: 8px;
  background: rgba(48, 215, 255, 0.07);
  box-shadow:
    0 0 0 2px rgba(6, 18, 8, 0.62),
    0 0 18px rgba(48, 215, 255, 0.7);
  pointer-events: none;
  z-index: 9;
}

.active-hand-marker {
  position: absolute;
  left: 50%;
  bottom: -34px;
  transform: translateX(-50%);
  display: none;
  min-width: 72px;
  min-height: 20px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #30d7ff;
  border-radius: 999px;
  background: rgba(2, 23, 30, 0.9);
  color: #d6f8ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(48, 215, 255, 0.62);
  pointer-events: none;
  z-index: 12;
}

.active-hand-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #30d7ff;
}

.player-hand.active .active-hand-marker {
  display: none;
}

.player-hand.owned-by-other {
  opacity: 0.78;
}

.player-hand-1 {
  left: auto;
  right: 2%;
  top: 16px;
}

.player-hand-2 {
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
}

.player-hand-3 {
  left: 2%;
  right: auto;
  top: 16px;
}

.player-hand.active .hand-label {
  border-color: #f5ea19;
  color: #fff5b8;
}

.player-hand .cards {
  min-height: 82px;
}

.player-card-stack {
  position: relative;
  width: 58px;
  min-height: 118px;
  display: block;
}

.player-card-stack.double-card-stack {
  width: 82px;
  min-height: 132px;
}

.player-card-stack .card {
  position: absolute;
  left: 0;
}

.player-card-stack .card.double-down-card {
  left: -12px;
  --card-rest-transform: translate3d(0, 0, 0) rotateX(0deg) rotateZ(90deg) scale(1);
  transform: var(--card-rest-transform);
  transform-origin: center;
}

.player-hand .card {
  width: 58px;
  height: 82px;
  padding: 5px;
}

.player-hand .card-top,
.player-hand .card-bottom {
  font-size: 15px;
}

.player-hand .card-center {
  font-size: 23px;
}

.player-hand .score-badge {
  position: absolute;
  right: -36px;
  top: 28px;
  min-width: 38px;
  min-height: 30px;
  font-size: 15px;
}

.hand-result-badge {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 22px auto;
  align-items: center;
  gap: 5px;
  min-width: 74px;
  min-height: 28px;
  padding: 2px 9px 2px 4px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(5, 16, 7, 0.92);
  color: #fff8df;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 0 14px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 14;
}

.hand-result-badge.win {
  border-color: rgba(94, 245, 98, 0.9);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(94, 245, 98, 0.36);
}

.hand-result-badge.loss {
  border-color: rgba(255, 71, 71, 0.9);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(255, 71, 71, 0.32);
}

.hand-result-badge.push {
  border-color: rgba(255, 216, 70, 0.92);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(255, 216, 70, 0.32);
}

.hand-result-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hand-result-badge.win .hand-result-icon {
  background: #38d85f;
}

.hand-result-badge.win .hand-result-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 7px;
  height: 12px;
  border-right: 3px solid #041306;
  border-bottom: 3px solid #041306;
  transform: rotate(42deg);
}

.hand-result-badge.loss .hand-result-icon {
  background: #ff4747;
}

.hand-result-badge.loss .hand-result-icon::before,
.hand-result-badge.loss .hand-result-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #1b0303;
}

.hand-result-badge.loss .hand-result-icon::before {
  transform: rotate(45deg);
}

.hand-result-badge.loss .hand-result-icon::after {
  transform: rotate(-45deg);
}

.hand-result-badge.push .hand-result-icon {
  background: #ffd846;
}

.hand-result-badge.push .hand-result-icon::before,
.hand-result-badge.push .hand-result-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #1d1600;
}

.hand-result-badge.push .hand-result-icon::before {
  top: 7px;
}

.hand-result-badge.push .hand-result-icon::after {
  top: 12px;
}

.hand-label {
  min-height: 25px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(201, 165, 84, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #e9ddbc;
  font-size: 12px;
  font-weight: 800;
}

.seat-label {
  min-width: 150px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold-dim);
  border-radius: 6px;
  background: rgba(4, 13, 7, 0.78);
  color: #f2ddb3;
  font-size: 22px;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 108px;
  perspective: 720px;
}

.card {
  position: relative;
  --card-rest-transform: translate3d(0, 0, 0) rotateX(0deg) rotateZ(0deg) scale(1);
  width: 76px;
  height: 106px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.95), transparent 28%),
    repeating-linear-gradient(112deg, rgba(0, 0, 0, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #fffdf7 0%, #f7f1e4 52%, #eee2ce 100%);
  color: #111;
  border: 1px solid rgba(25, 17, 8, 0.34);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    inset 0 -8px 14px rgba(98, 63, 28, 0.08),
    0 2px 2px rgba(255, 255, 255, 0.24),
    0 11px 20px rgba(0, 0, 0, 0.36),
    0 22px 34px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  padding: 7px;
  font-weight: 800;
  overflow: hidden;
  transform-style: preserve-3d;
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.card::before {
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.28), transparent 26% 68%, rgba(126, 74, 28, 0.08)),
    radial-gradient(circle at 86% 92%, rgba(0, 0, 0, 0.1), transparent 32%);
  mix-blend-mode: multiply;
  opacity: 0.54;
}

.card::after {
  inset: 3px;
  border: 1px solid rgba(120, 85, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.card-dealt {
  animation: deal-card 760ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
  animation-delay: var(--deal-delay, 0ms);
  will-change: transform, opacity, filter;
}

.player-card-stack .card.card-dealt.double-down-dealt {
  animation: deal-card-double-down 820ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
  animation-delay: var(--deal-delay, 0ms);
}

.player-card-stack .card.card-dealt.hit-card-dealt {
  animation: hit-card-slide 700ms cubic-bezier(0.17, 0.9, 0.24, 1) both;
  animation-delay: var(--deal-delay, 0ms);
}

@keyframes deal-card {
  0% {
    opacity: 0;
    filter: blur(1px) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.12));
    transform: translate3d(28px, -158px, 70px) rotateX(58deg) rotateZ(-11deg) scale(0.68);
  }

  62% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 16px 14px rgba(0, 0, 0, 0.28));
    transform: translate3d(-2px, 9px, 12px) rotateX(-7deg) rotateZ(2.4deg) scale(1.045);
  }

  82% {
    transform: translate3d(0, -2px, 0) rotateX(2deg) rotateZ(-0.7deg) scale(0.992);
  }

  100% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    transform: var(--card-rest-transform);
  }
}

@keyframes hit-card-slide {
  0% {
    opacity: 0;
    filter: blur(1px) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.12));
    transform: translate3d(92px, -72px, 64px) rotateX(44deg) rotateZ(14deg) scale(0.72);
  }

  54% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 16px 14px rgba(0, 0, 0, 0.3));
    transform: translate3d(-7px, 8px, 12px) rotateX(-7deg) rotateZ(-2deg) scale(1.05);
  }

  78% {
    transform: translate3d(2px, -2px, 0) rotateX(2deg) rotateZ(0.8deg) scale(0.99);
  }

  100% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    transform: var(--card-rest-transform);
  }
}

@keyframes deal-card-double-down {
  0% {
    opacity: 0;
    filter: blur(1px) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.12));
    transform: translate3d(72px, -168px, 78px) rotateX(62deg) rotateZ(42deg) scale(0.66);
  }

  36% {
    opacity: 1;
    filter: blur(0.5px) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.24));
    transform: translate3d(28px, -52px, 42px) rotateX(22deg) rotateZ(76deg) scale(0.88);
  }

  62% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 16px 14px rgba(0, 0, 0, 0.28));
    transform: translate3d(-9px, 8px, 12px) rotateX(-6deg) rotateZ(96deg) scale(1.055);
  }

  82% {
    transform: translate3d(3px, -2px, 0) rotateX(2deg) rotateZ(88deg) scale(0.99);
  }

  100% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    transform: var(--card-rest-transform);
  }
}

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

.card.red {
  color: #b51f25;
}

.card-top,
.card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
  font-size: 21px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.card-top span:last-child,
.card-bottom span:last-child {
  font-size: 0.82em;
}

.card-bottom {
  transform: rotate(180deg);
}

.card-center {
  position: relative;
  z-index: 1;
  place-self: center;
  font-size: 31px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.56),
    0 2px 5px rgba(0, 0, 0, 0.08);
}

.card-back {
  background:
    linear-gradient(45deg, transparent 46%, #8b231b 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #8b231b 46% 54%, transparent 54%),
    #f2dfd2;
  border: 5px solid #f8f1e8;
}

.small-card {
  width: 48px;
  height: 68px;
}

.score-badge {
  position: absolute;
  right: -60px;
  top: 58px;
  min-width: 46px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold-dim);
  border-radius: 6px;
  background: rgba(9, 14, 11, 0.9);
  color: #f7efcf;
  font-size: 20px;
  font-weight: 800;
}

.table-logo {
  position: absolute;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  color: rgba(212, 181, 107, 0.58);
  text-align: center;
  pointer-events: none;
  z-index: 0;
}

.table-logo span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  font-size: clamp(44px, 6vw, 74px);
  line-height: 0.9;
}

.table-logo small {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.betting-layout {
  position: absolute;
  left: 50%;
  bottom: 156px;
  transform: translateX(-50%);
  width: min(700px, 86%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  z-index: 1;
}

.bet-spot {
  color: inherit;
  cursor: pointer;
  appearance: none;
  border: 0;
}

.seat-bet-cluster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "pair trilux"
    "main main";
  gap: 6px 8px;
}

.seat-left {
  transform: rotate(5deg) translateY(8px);
}

.seat-center {
  transform: translateY(-6px);
}

.seat-right {
  transform: rotate(-5deg) translateY(8px);
}

.mini-bet,
.main-bet-box {
  min-width: 0;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(118, 20, 23, 0.58), transparent 66%),
    rgba(50, 8, 11, 0.68);
  color: #fff4d1;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.26),
    0 12px 22px rgba(0, 0, 0, 0.24);
}

.mini-bet {
  min-height: 74px;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  align-items: end;
  padding: 9px;
  text-align: center;
  position: relative;
}

.mini-bet::before,
.main-bet-box::before {
  content: "";
  justify-self: center;
  width: 44px;
  height: 58px;
  border: 5px solid #f5ea19;
  transform: rotate(4deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.trilux-mini::before {
  transform: rotate(-5deg);
}

.bet-print-title,
.mini-bet span {
  color: #fff6d5;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.55);
}

.felt-paytable {
  display: none;
  gap: 2px;
  color: #fff8e5;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.pair-print {
  left: 4%;
}

.trilux-print {
  right: 4%;
  text-align: right;
}

.felt-paytable b {
  margin-bottom: 1px;
  font-size: 11px;
  color: #ffffff;
}

.pair-mini {
  grid-area: pair;
}

.trilux-mini {
  grid-area: trilux;
}

.main-bet-box {
  grid-area: main;
  min-height: 92px;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  font-size: 20px;
  text-align: center;
}

.main-bet-box::before {
  width: 52px;
  height: 66px;
  transform: rotate(0deg);
}

.bet-spot.selected {
  box-shadow:
    inset 0 0 0 3px rgba(245, 234, 25, 0.72),
    inset 0 0 30px rgba(245, 234, 25, 0.2),
    0 14px 26px rgba(0, 0, 0, 0.28);
}

.bet-spot.drag-over {
  box-shadow:
    inset 0 0 0 4px rgba(98, 223, 88, 0.78),
    inset 0 0 32px rgba(98, 223, 88, 0.24),
    0 14px 26px rgba(0, 0, 0, 0.28);
}

.wager-chip {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 7px dashed rgba(255, 255, 255, 0.8);
  background: #b52225;
  color: white;
  font-weight: 900;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.32), 0 10px 18px rgba(0, 0, 0, 0.35);
}

.wager-chip.blue {
  background: #1e68b7;
}

.wager-chip.mini {
  width: 36px;
  height: 36px;
  border-width: 5px;
  font-size: 11px;
}

.wager-chip.green {
  width: 58px;
  height: 58px;
  background: #237b48;
  font-size: 14px;
}

.status-line {
  position: absolute;
  left: 50%;
  bottom: 106px;
  transform: translateX(-50%);
  min-width: min(560px, 84%);
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 18px;
  border: 1px solid rgba(201, 165, 84, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #eee1c7;
  font-size: 15px;
  text-align: center;
}

.action-bar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 12px;
  width: min(820px, calc(100% - 48px));
}

.action {
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: linear-gradient(180deg, #263741, #12191d);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.4);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  line-height: 1;
}

.action span,
.table-utility-button span,
.chip span {
  display: block;
}

.action.deal {
  background: linear-gradient(180deg, #257543, #0d351c);
}

.action.stand {
  background: linear-gradient(180deg, #672724, #2b0d0b);
}

.action:disabled,
.ghost-button:disabled,
.utility-button:disabled,
.chip:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hand-tabs {
  display: flex;
  gap: 8px;
  min-height: 30px;
}

.hand-tab {
  min-width: 74px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--muted);
  font-size: 13px;
  display: grid;
  place-items: center;
}

.hand-tab.active {
  border-color: var(--gold);
  color: var(--text);
}

.history-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  padding: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.history-panel {
  flex: 1 1 auto;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.history-panel .history-list {
  flex: 1 1 auto;
}

.history-item {
  min-height: 96px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  line-height: 1.2;
  overflow: hidden;
}

.history-item span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-item > span:first-child {
  align-self: stretch;
  align-content: start;
  max-width: 100%;
}

.history-item b {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-item small {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  min-width: 0;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: rgba(201, 165, 84, 0.5);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.history-item-action {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  white-space: nowrap;
  min-width: 0;
}

.history-item-action strong {
  min-width: 0;
  max-width: calc(100% - 66px);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.history-item-action small {
  flex: 0 0 auto;
  font-size: 11px;
}

.history-summary {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-hand {
  display: grid;
  gap: 2px;
  padding-top: 5px;
}

.history-hand + .history-hand {
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.history-item em {
  font-style: normal;
}

.history-item strong.win,
.history-item em.win {
  color: var(--green);
}

.history-item strong.loss,
.history-item em.loss {
  color: var(--red);
}

.history-item strong.push,
.history-item em.push {
  color: #f5d278;
}

.double-decision-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}

.double-decision-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(201, 165, 84, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 25, 22, 0.96), rgba(9, 10, 9, 0.96));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.36),
    0 24px 64px rgba(0, 0, 0, 0.64);
  text-align: center;
}

.double-decision-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.double-decision-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.double-decision-countdown {
  color: #f5d278;
  font-size: 15px;
  font-weight: 800;
}

.double-decision-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.decision-button {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  display: grid;
  place-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.decision-button kbd {
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 248, 216, 0.86);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.decision-button.play {
  background: linear-gradient(180deg, rgba(44, 155, 82, 0.95), rgba(13, 83, 43, 0.95));
}

.decision-button.withdraw {
  background: linear-gradient(180deg, rgba(116, 38, 32, 0.95), rgba(62, 18, 16, 0.95));
}

.decision-button:hover,
.decision-button:focus-visible {
  border-color: rgba(255, 242, 147, 0.8);
  outline: none;
  box-shadow: 0 0 0 3px rgba(243, 219, 40, 0.18);
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.history-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.history-modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(86vh, 820px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(201, 165, 84, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, #181917, #0d0e0d);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
}

.history-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-modal-header h2 {
  margin: 3px 0 0;
  font-size: 26px;
  line-height: 1.1;
}

.history-modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.history-modal-close:hover,
.history-modal-close:focus-visible {
  border-color: rgba(201, 165, 84, 0.58);
  outline: none;
}

.history-modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px 20px 20px;
}

.history-modal-dealer,
.history-modal-hand {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.history-modal-hands {
  display: grid;
  gap: 12px;
}

.history-modal-row-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.history-modal-row-title b {
  color: var(--text);
  font-size: 17px;
}

.history-modal-row-title strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.history-modal-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-modal-cards .card {
  width: 62px;
  height: 88px;
  padding: 6px;
}

.history-modal-cards .card-top,
.history-modal-cards .card-bottom {
  font-size: 16px;
}

.history-modal-cards .card-center {
  font-size: 25px;
}

.history-modal-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-modal-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
}

.history-modal strong.win,
.history-modal .win {
  color: var(--green);
}

.history-modal strong.loss,
.history-modal .loss {
  color: var(--red);
}

.history-modal strong.push,
.history-modal .push {
  color: #f5d278;
}

.rules-panel ul {
  margin: 0;
  padding: 14px 18px 18px 32px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    border: 0;
  }

  .rail-left {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand {
    min-height: 0;
  }

  .chip-panel {
    grid-template-columns: repeat(6, minmax(52px, 1fr));
  }

  .table-chip-panel {
    grid-template-columns: repeat(2, minmax(98px, 1fr)) repeat(4, 58px) repeat(3, minmax(62px, 1fr));
  }

  .table {
    min-height: 680px;
  }
}

.table {
  min-height: calc(100vh - 148px);
}

.action-bar {
  bottom: -92px;
}

.status-line {
  bottom: -34px;
}

/* Final table-space and betting-box refinements */
.table-wrap {
  align-items: start;
  padding: 0 8px 132px 10px;
}

.table {
  width: min(100%, 1460px);
  min-height: calc(100vh - 152px);
}

.betting-layout {
  bottom: 84px;
  width: min(1120px, 92%);
  height: 235px;
}

.seat-bet-cluster {
  width: 132px;
  height: 172px;
}

.seat-bet-cluster::before {
  left: 24px;
  width: 74px;
  height: 160px;
}

.seat-bet-cluster::after {
  left: 24px;
  width: 74px;
}

.seat-1 { left: auto; right: 2%; top: 12px; transform: rotate(0deg); }
.seat-2 { left: auto; right: 19%; top: 58px; transform: rotate(0deg); }
.seat-3 { left: auto; right: 36%; top: 88px; transform: rotate(0deg); }
.seat-4 { left: 36%; right: auto; top: 88px; transform: rotate(0deg); }
.seat-5 { left: 19%; right: auto; top: 58px; transform: rotate(0deg); }
.seat-6 { left: 2%; right: auto; top: 12px; transform: rotate(0deg); }

.pair-mini,
.main-bet-box {
  left: 24px;
  width: 74px;
}

.trilux-mini {
  right: 0;
  top: 64px;
}

.pair-mini span {
  transform: none;
}

.main-bet-box span {
  bottom: -24px;
}

.betting-layout .wager-chip {
  width: auto;
  height: 30px;
  min-width: 66px;
  max-width: 104px;
  border: 1px solid rgba(244, 234, 24, 0.75);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68) !important;
  color: #fff5b8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  line-height: 1;
  padding: 0 12px;
  display: grid;
  place-items: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.betting-layout .wager-chip.empty {
  display: none;
}

.betting-layout .wager-chip.side-win,
.betting-layout .wager-chip.main-win {
  border-color: rgba(109, 255, 116, 0.95);
  color: #ecffe9;
  box-shadow:
    inset 0 0 0 1px rgba(109, 255, 116, 0.58),
    0 0 0 2px rgba(109, 255, 116, 0.75),
    0 0 18px rgba(109, 255, 116, 0.52),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.pair-mini .wager-chip {
  right: -20px;
  top: 17px;
}

.trilux-mini .wager-chip {
  right: 0;
  top: 0;
}

.main-bet-box .wager-chip {
  right: -24px;
  top: 38px;
}

.game-shell {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 18vw);
  height: 100vh;
  overflow: hidden;
}

.rail-right {
  border-left: 1px solid var(--line);
  max-height: 100vh;
  overflow: hidden;
  padding: 16px 12px 10px;
  gap: 10px;
}

.rail-right .brand {
  min-height: 128px;
  justify-content: flex-start;
}

.rail-right .brand h1 {
  font-size: clamp(28px, 2.5vw, 40px);
  line-height: 1.05;
  padding-top: 2px;
}

.rail-right .panel-title {
  padding: 8px 14px;
  font-size: 15px;
}

.rail-right .bankroll {
  padding: 10px 14px 8px;
  font-size: clamp(24px, 2vw, 30px);
}

.rail-right .overall-bankroll {
  padding: 0 14px 12px;
}

.rail-right .bankroll-panel,
.rail-right .audio-panel {
  flex: 0 0 auto;
}

.rail-right .history-panel {
  min-height: 0;
}

.table-wrap {
  padding: 8px 8px 112px 12px;
  min-height: 100vh;
  align-items: start;
}

.table {
  width: min(100%, 1380px);
  min-height: calc(100vh - 126px);
  overflow: visible;
}

#shoeCount {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: #ffe7a0;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .table-wrap {
    padding: 10px 6px;
  }

  .rail-left {
    grid-template-columns: 1fr;
  }

  .table {
    min-height: 620px;
    border-width: 10px;
    border-radius: 28px;
  }

  .asm {
    width: 180px;
    height: 92px;
  }

  .discard-tray {
    display: none;
  }

  .betting-layout {
    bottom: 232px;
    width: calc(100% - 28px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .side-bet-box {
    height: 82px;
    padding: 8px;
    font-size: 18px;
  }

  .main-bet-box {
    min-height: 84px;
    padding: 10px 16px;
    font-size: 24px;
  }

  .wager-chip {
    width: 54px;
    height: 54px;
    border-width: 5px;
    font-size: 13px;
  }

  .wager-chip.green {
    width: 64px;
    height: 64px;
    font-size: 14px;
  }

  .dealer-area {
    top: 124px;
  }

  .player-area {
    bottom: 150px;
  }

  .card {
    width: 58px;
    height: 82px;
    padding: 5px;
  }

  .card-top,
  .card-bottom {
    font-size: 16px;
  }

  .card-center {
    font-size: 24px;
  }

  .score-badge {
    position: static;
    min-width: 44px;
  }

  .table-logo span {
    font-size: 38px;
  }

  .table-logo small {
    font-size: 11px;
  }

  .action-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    bottom: 16px;
  }

  .table-chip-panel {
    bottom: 142px;
    width: min(430px, calc(100% - 32px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .total-bet-pill,
  .round-pnl-pill {
    grid-column: span 2;
  }

  .table-chip-panel .chip {
    width: 56px;
    font-size: 12px;
  }

  .table-chip-panel .table-utility-button {
    grid-column: span 2;
    min-height: 34px;
  }

  .action {
    min-height: 56px;
    font-size: 15px;
  }
}

/* Reference-inspired casino table overhaul */
.table-wrap {
  padding: 18px 10px;
  align-items: center;
}

.table {
  width: min(100%, 1220px);
  min-height: 760px;
  border: 0;
  border-radius: 42px 42px 47% 47% / 26px 26px 26% 26%;
  background:
    radial-gradient(ellipse at 50% 75%, rgba(255, 255, 255, 0.08), transparent 58%),
    linear-gradient(180deg, #043022 0%, #012a1e 44%, #001f16 100%);
  box-shadow:
    inset 0 0 0 22px #d4a05f,
    inset 0 -26px 34px rgba(99, 55, 20, 0.35),
    0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.table::before {
  inset: 22px;
  border-radius: 28px 28px 46% 46% / 20px 20px 25% 25%;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.025), transparent 42%),
    repeating-linear-gradient(28deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 5px);
}

.table::after {
  content: "";
  position: absolute;
  top: 0;
  left: 39%;
  right: 39%;
  height: 32px;
  border: 12px solid #d4a05f;
  border-top: 0;
  border-radius: 0 0 28px 28px;
  background: white;
  z-index: 0;
}

.asm,
.discard-tray {
  display: none;
}

.table-equipment {
  position: absolute;
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
  width: min(500px, 46%);
  height: 86px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 82px;
  gap: 18px;
  align-items: center;
  z-index: 3;
}

.table-equipment #shoeCount,
.trilux-shuffler span {
  display: none;
}

.drop-slot {
  width: 32px;
  height: 58px;
  border-radius: 7px;
  background: linear-gradient(90deg, #83582b, #d3a15d 16%, #1a130a 25% 75%, #c59048);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.45), 0 8px 16px rgba(0,0,0,0.22);
}

.chip-tray {
  height: 76px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 8px solid #c0924a;
  border-radius: 6px;
  background: #080704;
  box-shadow: inset 0 0 0 2px #6b491d, 0 12px 20px rgba(0,0,0,0.3);
  overflow: hidden;
}

.tray-chip {
  width: 22px;
  height: 42px;
  border-radius: 2px 2px 1px 1px;
  background: repeating-linear-gradient(0deg, currentColor 0 4px, rgba(255,255,255,0.35) 4px 6px);
  color: #101010;
}

.tray-black { color: #101010; }
.tray-orange { color: #f07820; height: 50px; }
.tray-purple { color: #b78cff; height: 44px; }
.tray-green { color: #3f9f46; height: 48px; }

.trilux-shuffler {
  width: 78px;
  height: 102px;
  align-self: start;
  border-radius: 16px 18px 22px 22px;
  background:
    linear-gradient(180deg, #0b0b0b, #2a2928 38%, #050505 39% 100%);
  box-shadow: inset 0 0 0 5px #111, 0 18px 24px rgba(0,0,0,0.35);
  color: #d8b82f;
  display: grid;
  place-items: end center;
  padding: 0 10px 29px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.dealer-area {
  top: 166px;
  z-index: 4;
}

.dealer-area .seat-label {
  display: none;
}

.table-logo {
  top: 236px;
  z-index: 1;
  color: #f3d229;
  display: flex;
  align-items: start;
  justify-content: space-between;
  width: min(1120px, 88%);
  pointer-events: none;
}

.rc-table-brand {
  position: absolute;
  left: 54px;
  top: -66px;
  width: clamp(170px, 15vw, 260px);
  transform: none;
  opacity: 1;
  mix-blend-mode: normal;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.42));
}

.pair-print-main {
  color: #f4d51f;
  font-size: clamp(18px, 1.7vw, 25px);
  font-weight: 900;
  line-height: 1.04;
  text-align: left;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.felt-payouts {
  position: absolute;
  right: 0;
  top: -8px;
  display: grid;
  gap: 18px;
  width: 300px;
}

.trilux-summary,
.pair-summary {
  width: 280px;
  color: #eef5d8;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  text-align: left;
}

.table-logo .trilux-summary span,
.table-logo .trilux-summary b,
.table-logo .pair-summary span,
.table-logo .pair-summary b {
  display: inline;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.table-logo .trilux-summary span,
.table-logo .pair-summary span {
  color: #eef5d8;
  font-size: 12px;
  font-weight: 600;
}

.trilux-summary div,
.pair-summary div {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 10px;
  min-height: 20px;
  border-bottom: 1px solid rgba(244, 213, 31, 0.72);
}

.trilux-summary b,
.pair-summary b {
  color: #f4d51f;
  font-size: 13px;
}

.trilux-summary span:last-child,
.trilux-summary b:last-child,
.pair-summary span:last-child,
.pair-summary b:last-child {
  text-align: right;
}

.player-hands {
  top: auto;
  bottom: 122px;
  width: min(920px, 88%);
  height: 230px;
}

.player-hand {
  width: 104px;
  height: 174px;
  isolation: isolate;
}

.player-hand .cards {
  position: absolute;
  left: 23px;
  top: -96px;
}

.player-hand .score-badge {
  right: -26px;
  top: -66px;
  z-index: 10;
}

.split-main-chip {
  position: absolute;
  left: calc(100% - 12px);
  top: -30px;
  transform: none;
  z-index: 11;
  min-width: 72px;
  max-width: 112px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 24, 0.82);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff5b8;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.split-hand.active::before {
  height: 136px;
}

.split-hand .active-hand-marker {
  left: -74px;
  top: -56px;
  bottom: auto;
  transform: none;
  z-index: 24;
}

.split-hand .active-hand-marker::before {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 7px solid #30d7ff;
  border-right: 0;
}

.split-hand:not(.cards-collected) .hand-result-badge {
  top: -132px;
  z-index: 26;
}

.split-hand.cards-collected .hand-result-badge {
  top: 42px;
  z-index: 26;
}

.split-main-chip.win {
  border-color: rgba(109, 255, 116, 0.95);
  color: #ecffe9;
  box-shadow:
    inset 0 0 0 1px rgba(109, 255, 116, 0.58),
    0 0 0 2px rgba(109, 255, 116, 0.75),
    0 0 18px rgba(109, 255, 116, 0.52),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.split-main-chip.push {
  border-color: rgba(238, 225, 199, 0.86);
  color: #eee1c7;
}

.player-hand.surrender-offered {
  cursor: pointer;
  pointer-events: auto;
}

.player-hand.surrender-offered::after {
  display: none;
}

.surrender-offer,
.surrender-note {
  position: absolute;
  left: 50%;
  z-index: 28;
  transform: translateX(-50%);
  min-width: 86px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

.surrender-offer {
  top: 70px;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 225, 103, 0.94);
  background: rgba(15, 10, 0, 0.88);
  color: #ffe167;
  box-shadow: 0 0 14px rgba(255, 225, 103, 0.36);
  cursor: pointer;
  pointer-events: auto;
}

.surrender-note {
  top: 70px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(238, 225, 199, 0.86);
  background: rgba(13, 9, 5, 0.82);
  color: #eee1c7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
}

.player-hand.cards-collected .cards,
.player-hand.cards-collected .score-badge {
  display: none;
}

.player-hand.cards-collected:not(.split-hand) .hand-result-badge {
  top: -50px;
}

.player-hand .hand-label {
  position: absolute;
  left: 10px;
  bottom: -6px;
  min-width: 88px;
}

.player-hand-1 { left: auto; right: 44px; top: 0; transform: rotate(18deg); }
.player-hand-2 { left: auto; right: calc(17% + 44px); top: 42px; transform: rotate(10deg); }
.player-hand-3 { left: auto; right: calc(34% + 44px); top: 70px; transform: rotate(3deg); }
.player-hand-4 { left: 34%; right: auto; top: 70px; transform: rotate(-3deg); }
.player-hand-5 { left: 17%; right: auto; top: 42px; transform: rotate(-10deg); }
.player-hand-6 { left: 0; right: auto; top: 0; transform: rotate(-18deg); }

.betting-layout {
  bottom: 122px;
  width: min(920px, 88%);
  height: 230px;
  display: block;
  z-index: 2;
}

.felt-callout {
  position: absolute;
  top: -150px;
  color: #f4d51f;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.pair-left { left: 3%; }
.pair-right { right: 3%; }

.seat-bet-cluster {
  position: absolute;
  width: 148px;
  height: 174px;
  display: block;
}

.seat-bet-cluster::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  width: 72px;
  height: 158px;
  border: 4px solid #f4ea18;
  background: rgba(13, 96, 48, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  z-index: 0;
}

.seat-bet-cluster::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 56px;
  width: 72px;
  height: 3px;
  background: #f4ea18;
  z-index: 0;
}

.seat-owner {
  position: absolute;
  left: 61px;
  bottom: -34px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: 136px;
  pointer-events: auto;
}

.seat-owner span,
.seat-owner button {
  min-height: 22px;
  max-width: 76px;
  padding: 0 8px;
  border: 1px solid rgba(255, 232, 118, 0.72);
  border-radius: 999px;
  background: rgba(9, 11, 9, 0.84);
  color: #fff6c8;
  font-size: 10px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-owner button {
  cursor: pointer;
}

.seat-bet-cluster.mine::before {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 0 18px rgba(98, 223, 88, 0.72);
}

.seat-bet-cluster.claimed-by-other {
  opacity: 0.74;
}

.seat-1 { left: auto; right: 0; top: 0; transform: rotate(18deg); }
.seat-2 { left: auto; right: 17%; top: 42px; transform: rotate(10deg); }
.seat-3 { left: auto; right: 34%; top: 70px; transform: rotate(3deg); }
.seat-4 { left: 34%; right: auto; top: 70px; transform: rotate(-3deg); }
.seat-5 { left: 17%; right: auto; top: 42px; transform: rotate(-10deg); }
.seat-6 { left: 0; right: auto; top: 0; transform: rotate(-18deg); }

.mini-bet,
.main-bet-box {
  position: absolute;
  background: transparent;
  box-shadow: none;
  color: #f4d51f;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.pair-mini {
  left: 16px;
  top: 0;
  width: 80px;
  height: 64px;
  z-index: 1;
}

.trilux-mini {
  right: 0;
  top: 62px;
  width: 62px;
  height: 78px;
}

.main-bet-box {
  left: 12px;
  top: 56px;
  bottom: auto;
  width: 88px;
  height: 106px;
  min-height: 0;
  display: block;
  padding: 0;
  z-index: 1;
}

.mini-bet::before,
.main-bet-box::before {
  display: none;
}

.trilux-mini::before {
  display: none;
}

.mini-bet span,
.main-bet-box span {
  position: absolute;
  z-index: 1;
  color: #f4d51f;
  font-size: 14px;
  font-weight: 900;
  line-height: 0.92;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
}

.pair-mini span {
  top: 10px;
  left: 8px;
  right: 8px;
  transform: none;
  font-size: 18px;
}

.trilux-mini span {
  left: 0;
  bottom: 8px;
  color: white;
  font-size: 18px;
  line-height: 0.78;
  transform: rotate(-8deg);
  text-shadow:
    -2px 0 #315f9b,
    2px 0 #315f9b,
    0 2px #315f9b,
    0 -2px #315f9b;
}

.trilux-mini small {
  color: #cde7ff;
  font-size: 10px;
  letter-spacing: 1px;
}

.main-bet-box span {
  left: -2px;
  bottom: -28px;
  width: 76px;
  color: #f4d51f;
  font-size: 14px;
}

.wager-chip {
  position: absolute;
  z-index: 3;
}

.wager-chip.mini {
  width: auto;
  height: 30px;
  min-width: 66px;
  max-width: 104px;
  border-width: 1px;
  font-size: 12px;
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
}

.trilux-mini .wager-chip {
  left: 50%;
  right: auto;
  top: 24px;
  transform: translateX(-50%);
}

.wager-chip.green {
  width: auto;
  height: 30px;
  min-width: 72px;
  max-width: 112px;
  font-size: 12px;
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
}

.bet-spot.selected {
  outline: 0;
  filter: drop-shadow(0 0 8px rgba(244, 234, 24, 0.85));
  box-shadow: none;
}

.bet-spot.drag-over {
  outline: 3px solid rgba(98, 223, 88, 0.9);
  outline-offset: -7px;
  filter: drop-shadow(0 0 12px rgba(98, 223, 88, 0.95));
  box-shadow: none;
}

body.chip-dragging .bet-spot {
  cursor: copy;
}

body.chip-dragging .bet-spot:not(.drop-eligible) {
  filter: saturate(0.82) brightness(0.82);
  opacity: 0.7;
}

body.chip-dragging .bet-spot.drop-eligible {
  outline: 1px solid rgba(225, 225, 210, 0.68);
  outline-offset: -2px;
  filter:
    drop-shadow(0 0 5px rgba(225, 225, 210, 0.34))
    drop-shadow(0 0 10px rgba(0, 0, 0, 0.18));
}

body.chip-dragging .main-bet-box.drop-eligible,
body.chip-dragging .pair-mini.drop-eligible {
  box-shadow:
    inset 0 0 0 1px rgba(225, 225, 210, 0.38),
    inset 0 0 18px rgba(225, 225, 210, 0.08);
}

body.chip-dragging .pair-mini.drop-eligible {
  background:
    linear-gradient(180deg, rgba(215, 215, 196, 0.1), rgba(215, 215, 196, 0.035));
}

body.chip-dragging .main-bet-box.drop-eligible {
  background:
    linear-gradient(180deg, transparent 0 7px, rgba(215, 215, 196, 0.08) 7px 100%);
}

body.chip-dragging .trilux-mini.drop-eligible {
  outline-offset: 1px;
  box-shadow: 0 0 0 1px rgba(225, 225, 210, 0.42);
}

body.chip-dragging .bet-spot.drop-eligible.drag-over {
  outline-color: rgba(235, 235, 220, 0.96);
  filter:
    drop-shadow(0 0 7px rgba(235, 235, 220, 0.5))
    drop-shadow(0 0 12px rgba(0, 0, 0, 0.24));
}

body.chip-dragging .main-bet-box.drop-eligible.drag-over,
body.chip-dragging .pair-mini.drop-eligible.drag-over {
  box-shadow:
    inset 0 0 0 1px rgba(235, 235, 220, 0.62),
    inset 0 0 20px rgba(235, 235, 220, 0.12);
}

body.chip-dragging .pair-mini.drop-eligible.drag-over {
  background:
    linear-gradient(180deg, rgba(235, 235, 220, 0.13), rgba(235, 235, 220, 0.05));
}

body.chip-dragging .main-bet-box.drop-eligible.drag-over {
  background:
    linear-gradient(180deg, transparent 0 7px, rgba(235, 235, 220, 0.11) 7px 100%);
}

.trilux-paytable {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  width: min(420px, 46%);
  color: #eef5d8;
  font-size: 14px;
  z-index: 2;
}

.trilux-paytable div {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 16px;
  min-height: 23px;
  border-bottom: 1px solid rgba(244, 213, 31, 0.75);
}

.trilux-paytable b {
  color: #f4d51f;
  font-size: 17px;
}

.trilux-paytable span:last-child,
.trilux-paytable b:last-child {
  text-align: center;
}

.status-line {
  bottom: -38px;
  min-width: min(640px, 62%);
  z-index: 4;
  background: rgba(0, 0, 0, 0.72);
}

.action-bar {
  width: min(760px, calc(100% - 56px));
  position: fixed;
  left: 42%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 5;
}

.action {
  min-height: 58px;
}

@media (max-width: 1100px) {
  .table {
    min-height: 720px;
  }

  .table-equipment {
    top: 32px;
    width: 58%;
    grid-template-columns: 34px minmax(0, 1fr) 78px;
  }

  .trilux-shuffler {
    width: 74px;
    height: 98px;
  }

  .seat-bet-cluster {
    scale: 0.86;
  }

  .trilux-paytable {
    width: min(390px, 58%);
    font-size: 12px;
  }
}

/* Final viewport fit: keep controls off the felt */
.table-wrap {
  padding: 16px 8px 132px 10px;
  align-items: start;
}

.table {
  min-height: calc(100vh - 168px);
  background:
    radial-gradient(ellipse at 50% 70%, rgba(248, 236, 177, 0.12), transparent 46%),
    radial-gradient(ellipse at 24% 24%, rgba(83, 184, 129, 0.16), transparent 32%),
    radial-gradient(ellipse at 80% 34%, rgba(17, 85, 64, 0.3), transparent 38%),
    linear-gradient(180deg, #073b2a 0%, #012d20 42%, #001d15 100%);
  box-shadow:
    inset 0 0 0 22px #d7a864,
    inset 0 0 0 26px rgba(58, 32, 12, 0.76),
    inset 0 2px 18px rgba(255, 238, 177, 0.2),
    inset 0 -44px 54px rgba(49, 27, 9, 0.5),
    inset 0 0 120px rgba(0, 0, 0, 0.34),
    0 28px 82px rgba(0, 0, 0, 0.62);
}

.table::before {
  background:
    radial-gradient(ellipse at 50% 74%, rgba(255, 255, 255, 0.085), transparent 47%),
    linear-gradient(116deg, rgba(255, 255, 255, 0.035), transparent 34% 100%),
    repeating-linear-gradient(28deg, rgba(255,255,255,0.027) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(118deg, rgba(0, 0, 0, 0.09) 0 1px, transparent 1px 8px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 155, 0.1),
    inset 0 0 72px rgba(0, 0, 0, 0.22);
  opacity: 0.96;
}

.table::after {
  border-color: #d7a864;
  box-shadow:
    inset 0 -8px 16px rgba(132, 86, 30, 0.28),
    0 10px 18px rgba(0, 0, 0, 0.18);
}

.player-hand.active::before {
  display: none;
}

.player-hand.active .score-badge {
  border-color: rgba(255, 234, 82, 0.96);
  color: #fff5b8;
  box-shadow:
    0 0 0 2px rgba(8, 10, 6, 0.72),
    0 0 14px rgba(255, 234, 82, 0.62),
    0 0 26px rgba(255, 234, 82, 0.24);
}

.player-hand.active .cards {
  filter:
    drop-shadow(0 0 6px rgba(255, 234, 82, 0.36))
    drop-shadow(0 0 13px rgba(255, 234, 82, 0.18));
}

.player-hand.active .hand-label {
  border-color: rgba(255, 234, 82, 0.76);
  color: #fff6bf;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.38),
    0 0 10px rgba(255, 234, 82, 0.28);
}

.seat-bet-cluster.mine::before {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.16),
    inset 0 0 0 1px rgba(250, 238, 75, 0.12);
}

.bet-spot.selected {
  filter:
    drop-shadow(0 0 8px rgba(244, 234, 24, 0.92))
    drop-shadow(0 0 18px rgba(244, 234, 24, 0.36));
}

.wager-chip {
  --wager-transform: translate(0, 0);
}

.table-chip-panel .chip {
  transition:
    box-shadow 150ms ease,
    filter 150ms ease,
    transform 150ms ease;
}

.table-chip-panel .chip:not(:disabled):hover,
.table-chip-panel .chip:not(:disabled):focus-visible {
  filter: saturate(1.08) brightness(1.08);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    inset 0 0 0 4px rgba(0, 0, 0, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(255, 232, 118, 0.22);
}

.table-chip-panel .chip:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

.wager-chip.mini,
.wager-chip.green {
  --wager-transform: translate(-50%, -50%);
  transform: var(--wager-transform);
}

.trilux-mini .wager-chip {
  --wager-transform: translateX(-50%);
  transform: var(--wager-transform);
}

.betting-layout .wager-chip {
  isolation: isolate;
  overflow: visible;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.68);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    filter 160ms ease;
}

.betting-layout .wager-chip.wager-chip-pop {
  animation: wager-chip-drop 420ms cubic-bezier(0.19, 0.95, 0.22, 1.15) both;
}

.betting-layout .wager-chip.side-win,
.betting-layout .wager-chip.main-win {
  border-color: rgba(109, 255, 116, 0.92);
  color: #ecffe9;
}

.betting-layout .wager-chip.main-win {
  animation: wager-main-win-pulse 1100ms ease-in-out infinite;
}

.betting-layout .wager-chip.side-win {
  box-shadow:
    inset 0 0 0 1px rgba(109, 255, 116, 0.42),
    0 0 0 1px rgba(109, 255, 116, 0.5),
    0 0 10px rgba(109, 255, 116, 0.32),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.flying-chip {
  position: fixed;
  z-index: 1200;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 234, 24, 0.75);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff5b8;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.42),
    0 0 10px rgba(255, 232, 118, 0.18);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.flying-chip.blue {
  border-color: rgba(89, 181, 255, 0.76);
}

.flying-chip.green {
  border-color: rgba(109, 255, 116, 0.82);
  color: #ecffe9;
}

.flying-chip.to-dealer {
  animation: chip-flight-to-dealer 1180ms cubic-bezier(0.28, 0.02, 0.14, 1) both;
}

.flying-chip.to-player {
  animation: chip-flight-to-player 1050ms cubic-bezier(0.24, 0.02, 0.18, 1) both;
}

.flying-chip.from-dealer {
  animation: chip-flight-from-dealer 980ms cubic-bezier(0.19, 0.9, 0.22, 1) both;
}

@keyframes wager-chip-drop {
  0% {
    opacity: 0.72;
    transform: var(--wager-transform) translateY(-16px) scale(0.82);
  }

  58% {
    opacity: 1;
    transform: var(--wager-transform) translateY(3px) scale(1.08);
  }

  78% {
    transform: var(--wager-transform) translateY(-1px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: var(--wager-transform) translateY(0) scale(1);
  }
}

@keyframes chip-flight-to-dealer {
  0% {
    opacity: 1;
    filter: brightness(1.08);
    transform: translate3d(0, 0, 0) scale(1);
  }

  28% {
    opacity: 1;
    filter: brightness(1.16);
    transform: translate3d(calc(var(--chip-flight-x) * 0.24), calc(var(--chip-flight-y) * 0.24 - 86px), 0) scale(1.08);
  }

  64% {
    opacity: 0.94;
    transform: translate3d(calc(var(--chip-flight-x) * 0.68), calc(var(--chip-flight-y) * 0.68 - 120px), 0) scale(0.9);
  }

  100% {
    opacity: 0;
    filter: brightness(0.88);
    transform: translate3d(var(--chip-flight-x), var(--chip-flight-y), 0) scale(0.48);
  }
}

@keyframes chip-flight-from-dealer {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.62);
  }

  22% {
    opacity: 1;
  }

  70% {
    transform: translate3d(calc(var(--chip-flight-x) * 0.82), calc(var(--chip-flight-y) * 0.82 - 28px), 0) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--chip-flight-x), var(--chip-flight-y), 0) scale(0.94);
  }
}

@keyframes chip-flight-to-player {
  0% {
    opacity: 1;
    filter: brightness(1.08);
    transform: translate3d(0, 0, 0) scale(1);
  }

  34% {
    opacity: 1;
    filter: brightness(1.12);
    transform: translate3d(calc(var(--chip-flight-x) * 0.28), calc(var(--chip-flight-y) * 0.28 - 38px), 0) scale(1.06);
  }

  78% {
    opacity: 0.96;
    transform: translate3d(calc(var(--chip-flight-x) * 0.82), calc(var(--chip-flight-y) * 0.82 - 18px), 0) scale(0.92);
  }

  100% {
    opacity: 0;
    filter: brightness(0.92);
    transform: translate3d(var(--chip-flight-x), var(--chip-flight-y), 0) scale(0.56);
  }
}

@keyframes wager-main-win-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(109, 255, 116, 0.58),
      0 0 0 2px rgba(109, 255, 116, 0.75),
      0 0 18px rgba(109, 255, 116, 0.52),
      0 4px 10px rgba(0, 0, 0, 0.28);
  }

  50% {
    box-shadow:
      inset 0 0 0 1px rgba(171, 255, 176, 0.76),
      0 0 0 3px rgba(146, 255, 151, 0.9),
      0 0 28px rgba(109, 255, 116, 0.74),
      0 7px 16px rgba(0, 0, 0, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .betting-layout .wager-chip.wager-chip-pop,
  .betting-layout .wager-chip.side-win,
  .betting-layout .wager-chip.main-win,
  .flying-chip {
    animation: none;
  }
}

.betting-layout {
  bottom: 104px;
  width: min(1180px, calc(100% - 96px));
  height: 260px;
}

.player-hands {
  top: auto;
  bottom: 104px;
  width: min(1180px, calc(100% - 96px));
  height: 260px;
}

.action-bar {
  position: fixed;
  left: 42%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 56px));
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 10px;
}

/* Inward fan for the six printed hand boxes, ordered right to left. */
.seat-1 { left: auto; right: 1.5%; top: 18px; transform: rotate(-13deg); }
.seat-2 { left: auto; right: 18.5%; top: 50px; transform: rotate(-8deg); }
.seat-3 { left: auto; right: 35.5%; top: 72px; transform: rotate(-2deg); }
.seat-4 { left: 35.5%; right: auto; top: 72px; transform: rotate(2deg); }
.seat-5 { left: 18.5%; right: auto; top: 50px; transform: rotate(8deg); }
.seat-6 { left: 1.5%; right: auto; top: 18px; transform: rotate(13deg); }

.player-hand {
  --split-x: 0px;
  --split-y: 0px;
}

.player-hand-1 { left: auto; right: calc(1.5% + 44px); top: 18px; transform: translate(var(--split-x), var(--split-y)) rotate(-13deg); }
.player-hand-2 { left: auto; right: calc(18.5% + 44px); top: 50px; transform: translate(var(--split-x), var(--split-y)) rotate(-8deg); }
.player-hand-3 { left: auto; right: calc(35.5% + 44px); top: 72px; transform: translate(var(--split-x), var(--split-y)) rotate(-2deg); }
.player-hand-4 { left: 35.5%; right: auto; top: 72px; transform: translate(var(--split-x), var(--split-y)) rotate(2deg); }
.player-hand-5 { left: 18.5%; right: auto; top: 50px; transform: translate(var(--split-x), var(--split-y)) rotate(8deg); }
.player-hand-6 { left: 1.5%; right: auto; top: 18px; transform: translate(var(--split-x), var(--split-y)) rotate(13deg); }

.split-hand .hand-label {
  min-width: 94px;
  bottom: -2px;
}

/* Keep Trilux outside the printed box while aligned to the pair/main divider. */
.trilux-mini {
  right: -8px;
  top: 39px;
  width: 56px;
  height: 35px;
  z-index: 2;
  min-height: 0;
  background-image: url("assets/trilux-logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.trilux-mini span {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.trilux-mini small {
  font-size: inherit;
}

.trilux-mini .wager-chip {
  left: 50%;
  right: auto;
  top: 37px;
  transform: translateX(-50%);
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .game-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .rail-right {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .table-chip-panel {
    bottom: 224px;
  }

  .action-bar {
    left: 50%;
    bottom: 16px;
    width: calc(100% - 24px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

.nav-button {
  display: grid;
  place-items: center;
  text-decoration: none;
  text-align: center;
}

.stats-body,
.admin-body {
  min-height: 100vh;
  overflow: auto;
}

.game-shell[hidden],
.app-stats-view[hidden],
.app-admin-view[hidden] {
  display: none;
}

.stats-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.stats-brand {
  min-height: 72px;
}

.stats-view-switcher {
  width: min(360px, 32vw);
  margin-top: 0;
}

.stats-brand p {
  color: var(--gold);
  font-size: 15px;
}

.stats-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(100%, 360px);
}

.stats-nav .nav-button {
  width: 150px;
  margin: 0;
}

.stats-nav .nav-button.danger {
  border-color: rgba(239, 77, 68, 0.48);
  color: #ffd8d5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 3px solid rgba(201, 165, 84, 0.8);
  background:
    linear-gradient(110deg, rgba(201, 165, 84, 0.1), transparent 46%),
    radial-gradient(circle at 86% 14%, rgba(255, 235, 154, 0.08), transparent 34%);
  pointer-events: none;
}

.stat-card span,
.stat-card small {
  position: relative;
  color: var(--muted);
}

.stat-card strong {
  position: relative;
  color: var(--text);
  font-size: clamp(24px, 2.4vw, 34px);
  font-variant-numeric: tabular-nums;
}

.stat-card strong.stat-value-updated {
  animation: stat-value-pop 520ms ease both;
}

@keyframes stat-value-pop {
  0% {
    filter: brightness(1);
    transform: translateY(0) scale(1);
  }

  38% {
    filter: brightness(1.22);
    transform: translateY(-1px) scale(1.035);
  }

  100% {
    filter: brightness(1);
    transform: translateY(0) scale(1);
  }
}

.set-balance-form {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.set-balance-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.set-balance-form div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
}

.set-balance-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.36);
  color: var(--text);
  font: inherit;
  padding: 0 10px;
}

.set-balance-form .ghost-button {
  width: 100%;
  min-height: 38px;
  margin: 0;
}

.admin-users-panel {
  margin-top: 12px;
  overflow: hidden;
}

.admin-users-table {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) rgba(255, 255, 255, 0.06);
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(6, minmax(92px, 1fr)) minmax(148px, auto);
  align-items: center;
  gap: 10px;
  min-width: 940px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 13px;
}

.admin-user-header {
  min-height: 34px;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-user-name strong,
.admin-user-row > strong {
  color: var(--text);
}

.admin-user-name small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row span,
.admin-user-row > strong {
  font-variant-numeric: tabular-nums;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-user-actions .ghost-button {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
}

.ghost-button.danger {
  border-color: rgba(239, 77, 68, 0.48);
  color: #ffd8d5;
}

.ghost-button.danger:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.34);
}

.stats-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-panel {
  min-height: 280px;
}

.recent-rounds-panel {
  display: flex;
  flex-direction: column;
}

.result-bars {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.result-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.result-bar-row strong {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.result-bar,
.trend-bar {
  height: 100%;
  border-radius: inherit;
}

.result-bar.win,
.trend-bar.win {
  background: var(--green);
}

.result-bar.loss,
.trend-bar.loss {
  background: var(--red);
}

.result-bar.push,
.trend-bar.push {
  background: var(--gold);
}

.stats-table,
.hit-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.stats-row,
.hit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 13px;
}

.stats-row strong,
.hit-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.win {
  color: var(--green) !important;
}

.loss {
  color: var(--red) !important;
}

.push {
  color: var(--gold) !important;
}

.trend-bars {
  min-height: 184px;
  padding: 14px 16px 10px;
}

.bankroll-trend {
  display: grid;
  grid-template-rows: auto minmax(128px, 1fr) 18px;
  gap: 8px;
  min-height: 160px;
}

.bankroll-trend-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.bankroll-trend-meta strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bankroll-trend-chart {
  width: 100%;
  min-height: 128px;
  overflow: visible;
}

.bankroll-trend-zero {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.bankroll-trend-line {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: bankroll-line-draw 850ms cubic-bezier(0.19, 0.9, 0.22, 1) forwards;
}

.bankroll-trend-glow {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  opacity: 0.22;
  filter: blur(1.2px);
  vector-effect: non-scaling-stroke;
}

.bankroll-trend-area {
  fill: url("#bankrollTrendFill");
  opacity: 0.62;
  transform-origin: center bottom;
  animation: bankroll-area-rise 700ms ease-out both;
}

.bankroll-trend-line.win {
  stroke: var(--green);
}

.bankroll-trend-line.loss {
  stroke: var(--red);
}

.bankroll-trend-line.push {
  stroke: var(--gold);
}

.bankroll-trend-glow.win,
.bankroll-trend-area.win {
  color: var(--green);
}

.bankroll-trend-glow.loss,
.bankroll-trend-area.loss {
  color: var(--red);
}

.bankroll-trend-glow.push,
.bankroll-trend-area.push {
  color: var(--gold);
}

.bankroll-trend-point {
  fill: var(--gold);
  stroke: var(--panel);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  animation: bankroll-point-pop 520ms ease both;
}

.bankroll-trend-point.win {
  fill: var(--green);
}

.bankroll-trend-point.loss {
  fill: var(--red);
}

.bankroll-trend-point.push {
  fill: var(--gold);
}

.bankroll-trend-labels {
  position: relative;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.bankroll-trend-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}

@keyframes bankroll-line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes bankroll-area-rise {
  from {
    opacity: 0;
    transform: scaleY(0.72);
  }

  to {
    opacity: 0.62;
    transform: scaleY(1);
  }
}

@keyframes bankroll-point-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card strong.stat-value-updated,
  .bankroll-trend-line,
  .bankroll-trend-area,
  .bankroll-trend-point {
    animation: none;
  }

  .bankroll-trend-line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

.recent-rounds-panel .stats-table {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) rgba(255, 255, 255, 0.06);
}

.empty-state {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .stats-header {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-view-switcher,
  .stats-nav .nav-button {
    width: 100%;
  }

  .stats-grid,
  .stats-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html {
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: calc(236px + env(safe-area-inset-bottom));
  }

  .game-shell {
    display: block;
    min-height: 100svh;
    overflow: visible;
  }

  .table-wrap {
    min-height: 0;
    padding: 8px 6px 24px;
  }

  .table {
    min-height: min(690px, calc(100svh - 28px));
    border-radius: 24px 24px 44% 44% / 18px 18px 18% 18%;
    box-shadow:
      inset 0 0 0 12px #d4a05f,
      inset 0 -18px 26px rgba(99, 55, 20, 0.34),
      0 18px 48px rgba(0, 0, 0, 0.48);
  }

  .table::before {
    inset: 12px;
    border-radius: 16px 16px 43% 43% / 12px 12px 17% 17%;
  }

  .table::after {
    left: 40%;
    right: 40%;
    height: 20px;
    border-width: 8px;
    border-top: 0;
    border-radius: 0 0 18px 18px;
  }

  .table-equipment {
    top: 18px;
    width: min(230px, 60%);
    height: 64px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }

  .drop-slot {
    width: 24px;
    height: 44px;
  }

  .chip-tray {
    height: 54px;
    gap: 4px;
    padding: 6px 8px;
    border-width: 5px;
  }

  .tray-chip {
    width: 15px;
    height: 31px;
  }

  .chip-tray .tray-chip:nth-child(n + 6) {
    display: none;
  }

  .trilux-shuffler {
    display: none;
  }

  #shoeCount {
    bottom: -18px;
    font-size: 10px;
  }

  .dealer-area {
    top: 102px;
  }

  .table-logo {
    display: none;
  }

  .rc-table-brand {
    display: none;
  }

  .felt-payouts,
  .trilux-paytable,
  .trilux-summary,
  .pair-summary {
    display: none;
  }

  .betting-layout,
  .player-hands {
    bottom: 268px;
    width: min(352px, calc(100% - 28px));
    height: 244px;
  }

  .seat-bet-cluster {
    width: 96px;
    height: 118px;
    scale: 1;
    transform-origin: center;
  }

  .seat-bet-cluster::before {
    left: 12px;
    width: 52px;
    height: 108px;
    border-width: 3px;
  }

  .seat-bet-cluster::after {
    left: 12px;
    top: 40px;
    width: 52px;
    height: 2px;
  }

  .seat-owner {
    left: 38px;
    bottom: -28px;
    gap: 4px;
    max-width: 104px;
  }

  .seat-owner span,
  .seat-owner button {
    max-width: 58px;
    min-height: 20px;
    padding: 0 6px;
    font-size: 9px;
    line-height: 18px;
  }

  .seat-1 { right: 0; top: 0; transform: rotate(-8deg); }
  .seat-2 { right: calc(50% - 48px); top: 20px; transform: rotate(0deg); }
  .seat-3 { right: auto; left: 0; top: 0; transform: rotate(8deg); }
  .seat-4 { left: 0; top: 126px; transform: rotate(-8deg); }
  .seat-5 { left: calc(50% - 48px); top: 146px; transform: rotate(0deg); }
  .seat-6 { left: auto; right: 0; top: 126px; transform: rotate(8deg); }

  .pair-mini {
    left: 12px;
    width: 58px;
    height: 44px;
  }

  .main-bet-box {
    left: 10px;
    top: 40px;
    width: 58px;
    height: 72px;
  }

  .trilux-mini {
    right: -3px;
    top: 44px;
    width: 42px;
    height: 30px;
    border: 2px solid rgba(244, 234, 24, 0.92);
    border-radius: 999px;
    background: rgba(3, 25, 35, 0.78);
    background-image: none;
  }

  .trilux-mini span {
    position: static;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    clip-path: none;
    overflow: hidden;
    color: #dff7ff;
    font-size: 9px;
    line-height: 1;
    transform: none;
    text-shadow: none;
    white-space: normal;
  }

  .trilux-mini small {
    display: none;
  }

  .pair-mini span {
    top: 7px;
    left: 5px;
    right: 5px;
    font-size: 12px;
  }

  .betting-layout .wager-chip,
  .wager-chip.mini,
  .wager-chip.green {
    min-width: 48px;
    max-width: 74px;
    height: 23px;
    padding: 0 7px;
    font-size: 9px;
    border-radius: 999px;
  }

  .trilux-mini .wager-chip {
    top: 28px;
  }

  .player-hand {
    width: 78px;
    height: 120px;
  }

  .player-hand-1 { right: 10px; top: 0; transform: translate(var(--split-x), var(--split-y)) rotate(-8deg); }
  .player-hand-2 { right: calc(50% - 38px); top: 20px; transform: translate(var(--split-x), var(--split-y)) rotate(0deg); }
  .player-hand-3 { left: 10px; top: 0; transform: translate(var(--split-x), var(--split-y)) rotate(8deg); }
  .player-hand-4 { left: 10px; top: 126px; transform: translate(var(--split-x), var(--split-y)) rotate(-8deg); }
  .player-hand-5 { left: calc(50% - 38px); top: 146px; transform: translate(var(--split-x), var(--split-y)) rotate(0deg); }
  .player-hand-6 { right: 10px; top: 126px; transform: translate(var(--split-x), var(--split-y)) rotate(8deg); }

  .player-hand .cards {
    left: 13px;
    top: -70px;
  }

  .player-hand .score-badge {
    right: -18px;
    top: -50px;
  }

  .player-hand .hand-label {
    left: 0;
    bottom: -4px;
    min-width: 76px;
    font-size: 10px;
  }

  .card {
    width: 42px;
    height: 60px;
    padding: 4px;
  }

  .player-card-stack .card {
    margin-left: -24px;
  }

  .player-card-stack .card:first-child {
    margin-left: 0;
  }

  .card-top,
  .card-bottom {
    font-size: 12px;
  }

  .card-center {
    font-size: 18px;
  }

  .score-badge {
    min-width: 34px;
    min-height: 24px;
    font-size: 12px;
  }

  .status-line {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(268px + env(safe-area-inset-bottom));
    transform: none;
    z-index: 8;
    min-width: 0;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
    background: rgba(5, 5, 5, 0.82);
    backdrop-filter: blur(7px);
  }

  .table-chip-panel {
    left: 0;
    right: 0;
    bottom: calc(122px + env(safe-area-inset-bottom));
    transform: none;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
    border-width: 1px 0;
    border-radius: 0;
    background: rgba(10, 10, 9, 0.9);
    backdrop-filter: blur(7px);
  }

  .total-bet-pill,
  .round-pnl-pill {
    grid-column: span 2;
    min-height: 34px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .total-bet-pill strong,
  .round-pnl-pill strong {
    font-size: 12px;
  }

  .table-chip-panel .chip {
    width: 52px;
    min-height: 52px;
    justify-self: center;
    border-width: 5px;
    font-size: 11px;
  }

  .table-chip-panel .table-utility-button {
    grid-column: span 1;
    min-height: 34px;
    padding: 0 7px;
    font-size: 11px;
  }

  .chip kbd,
  .action kbd,
  .table-utility-button kbd {
    display: none;
  }

  .action-bar {
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom);
    transform: none;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px 10px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(7px);
    z-index: 7;
  }

  .action {
    min-height: 50px;
    border-radius: 6px;
    font-size: 14px;
  }

  .rail-right {
    margin-top: 12px;
    padding-bottom: 16px;
  }

  .rail-right .brand {
    min-height: 0;
  }
}
