.bj-page {
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  color: #f5f6f8;
  font-family: Arial, Helvetica, sans-serif;
}

.bj-desktop {
  padding: 0;
}

.bj-mobile {
  max-width: none;
  padding: 0;
}

.bj-mobile .bj-stage {
  border-left: 0;
  border-right: 0;
  border-radius: 10px;
}

.bj-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
}

#blackjackCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  touch-action: manipulation;
}

.bj-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.bj-controls[hidden] {
  display: none;
}

.bj-casino-link,
.bj-controls button,
.bj-demo-actions button,
.bj-chat-form button {
  min-height: 30px;
  border: 1px solid #7e8da8;
  border-radius: 6px;
  background: linear-gradient(#fff, #d9e1ef);
  color: #111827;
  font-weight: bold;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 #7e8da8, 0 4px 8px rgba(0, 0, 0, .26);
  cursor: pointer;
  touch-action: manipulation;
}

.bj-casino-link {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 0 10px;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 28px;
}

.bj-controls button {
  min-width: 68px;
  pointer-events: auto;
}

.bj-casino-link:hover,
.bj-controls button:hover,
.bj-demo-actions button:hover,
.bj-chat-form button:hover,
.bj-step-btn:hover {
  background: linear-gradient(#fff, #e5ecf7);
}

.bj-casino-link:active,
.bj-controls button:active,
.bj-demo-actions button:active,
.bj-chat-form button:active,
.bj-step-btn:active,
.bj-popup button:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .18), 0 1px 0 #7e8da8, 0 2px 4px rgba(0, 0, 0, .22);
}

.bj-action-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  color: #4a3218;
  font: bold 12px Arial, Helvetica, sans-serif;
}

.bj-table-list {
  margin: 6px 0 0;
  padding: 7px 8px;
  border: 1px solid #9c7b46;
  border-radius: 6px;
  background: #fff7d7;
  color: #2c2112;
  font: 12px Arial, Helvetica, sans-serif;
}

.bj-table-list[hidden] {
  display: none;
}

.bj-table-list-title {
  margin: 0 0 5px;
  color: #4a3218;
  font-weight: bold;
}

.bj-table-list-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bj-table-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(110px, 2fr) minmax(54px, auto);
  gap: 7px;
  align-items: center;
  min-height: 28px;
  padding: 5px 6px;
  border: 1px solid #d0b577;
  border-radius: 5px;
  background: #fffdf0;
  color: #1f2933;
  text-decoration: none;
}

.bj-table-row:hover {
  background: #fff4bf;
}

.bj-table-code {
  font-weight: bold;
  overflow-wrap: anywhere;
}

.bj-table-meta {
  color: #55442b;
}

.bj-table-open {
  justify-self: end;
  color: #0d6634;
  font-weight: bold;
  white-space: nowrap;
}

.bj-bet-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.bj-step-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #7e8da8;
  border-radius: 6px;
  background: linear-gradient(#fff, #d9e1ef);
  color: #111827;
  font: bold 18px Arial, Helvetica, sans-serif;
  line-height: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 #7e8da8, 0 4px 8px rgba(0, 0, 0, .22);
  cursor: pointer;
  touch-action: manipulation;
}

.bj-chip-display {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px dashed #ffd5d7;
  border-radius: 50%;
  background: #c5363d;
  box-shadow: inset 0 0 0 3px #8f2028, 0 1px 2px rgba(0, 0, 0, .35);
  color: #fff;
  font: bold 12px Arial, Helvetica, sans-serif;
  text-align: center;
}

.bj-status {
  display: none;
  margin: 6px 0 0;
  padding: 6px 8px;
  border: 1px solid #a33;
  background: #fff1f1;
  color: #801d1d;
  font: bold 12px Arial, Helvetica, sans-serif;
}

.bj-popup {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .42);
}

.bj-popup[hidden] {
  display: none;
}

.bj-popup-box {
  width: min(320px, 92vw);
  border: 2px solid #f2d18a;
  border-radius: 8px;
  padding: 14px 14px 12px;
  background: #fff7dd;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  color: #4a3218;
  text-align: center;
  font: bold 14px Arial, Helvetica, sans-serif;
}

.bj-popup-message {
  margin-bottom: 12px;
  line-height: 1.3;
}

.bj-popup button {
  min-width: 70px;
  min-height: 30px;
  border: 1px solid #7e8da8;
  border-radius: 6px;
  background: linear-gradient(#fff, #d9e1ef);
  color: #111827;
  font: bold 13px Arial, Helvetica, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 #7e8da8, 0 4px 8px rgba(0, 0, 0, .24);
  cursor: pointer;
}

.bj-demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 6px 0 0;
}

.bj-chat {
  border: 1px solid #303a4d;
  border-radius: 8px;
  background: #1b2230;
  overflow: hidden;
}

.bj-chat-head {
  padding: 7px 9px;
  background: #273248;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.bj-chat-row {
  padding: 7px 9px;
  border-top: 1px solid #303a4d;
  color: #d8deeb;
  font-size: 13px;
}

.bj-chat-name {
  color: #ffd36d;
  font-weight: bold;
}

.bj-chat-form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #303a4d;
}

.bj-chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #556176;
  border-radius: 6px;
  padding: 7px;
  background: #111720;
  color: #fff;
}

@media (max-width: 420px) {
  .bj-page {
    padding: 0;
  }

  .bj-controls {
    left: 0;
    right: 0;
    bottom: 6px;
    gap: 5px;
  }

  .bj-controls button {
    min-width: 58px;
    font-size: 12px;
  }

  .bj-table-list {
    margin-left: 6px;
    margin-right: 6px;
  }

  .bj-table-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .bj-table-open {
    justify-self: start;
  }
}

@media (min-width: 800px) {
  #cufContent {
    width: 66%;
  }

  #cufSideBar {
    width: 32%;
    padding-left: 2%;
  }

  .bj-desktop .bj-demo-actions {
    justify-content: center;
  }
}
