
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  text-decoration: none;
  background: none;
  -webkit-font-smoothing: antialiased;
}
menu, ol, ul { list-style-type: none; }
body {
  font-family: 'Montserrat', sans-serif;
  background: #06080e;
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }

.app-layout {
  display: grid;
  grid-template-columns: 236px 1fr 301px;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  background: #06080e;
  border-right: 1px solid #131a27;
  width: 236px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #131a27; border-radius: 2px; }
.sidebar-inner {
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 25px;
}
.logo-live-indicator {
  width: 16px; height: 16px;
  background: rgba(108, 24, 25, 0.51);
  border: 0.5px solid rgba(167, 36, 36, 0.42);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.live-dot {
  width: 6px; height: 6px;
  background: #e22b2b;
  border-radius: 50%;
  box-shadow: 0px 0px 5.2px 0px rgba(167, 36, 36, 1);
  display: block;
}
.logo-live-indicator.live {
  background: rgba(24, 108, 30, 0.51);
  border-color: rgba(36, 167, 44, 0.42);
  cursor: pointer;
}
.logo-live-indicator.live .live-dot {
  background: #cffe1a;
  box-shadow: 0px 0px 5.2px 0px rgba(207, 254, 26, 0.8);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}
.logo-img { height: 21px; width: auto; object-fit: contain; }
.sidebar-section { padding: 10px 0; }
.sidebar-section-title {
  color: #8ba4ba;
  font-size: 9px;
  font-weight: 800;
  padding: 8px 27px;
  letter-spacing: 0.5px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 27px 8px 28px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s;
  position: relative;
}
.sidebar-link:hover { opacity: 0.8; }
.sidebar-link.muted { color: #88969c; font-weight: 600; }
.sidebar-icon { width: 19px; height: 19px; flex-shrink: 0; object-fit: contain; }
.sidebar-icon-placeholder { width: 19px; height: 19px; flex-shrink: 0; }
.soon-badge {
  background: #2c3c47;
  border-radius: 2px;
  font-size: 6px;
  font-weight: 800;
  color: #88969c;
  padding: 2px 5px;
  margin-left: 4px;
  transform: rotate(-3.377deg);
}
.sidebar-bottom { margin-top: auto; padding: 20px; }
.sidebar-social-card {
  background: #0e111a;
  border-radius: 5px;
  padding: 12px;
}
.sidebar-social-card .sidebar-section-title {
  padding: 0 0 10px 0;
  font-size: 12px;
}
.social-icons { display: flex; gap: 8px; }
.social-icon-btn {
  width: 25px; height: 25px;
  background: #131a27;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.social-icon-btn:hover { opacity: 0.7; }
.social-icon-btn img { width: 14px; height: 14px; object-fit: contain; }

.chat-sidebar {
  width: 301px;
  background: rgba(19, 26, 39, 0.1);
  border: 1px solid #131a27;
  border-radius: 7px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  margin: 24px 0;
  overflow: hidden;
}
.chat-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
}
.chat-close {
  width: 20px; height: 20px;
  cursor: pointer;
  opacity: 0.6;
}
.chat-close:hover { opacity: 1; }
.chat-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  flex: 1;
  text-align: center;
}
.chat-header-icons { display: flex; gap: 8px; }
.chat-icon {
  width: 16px; height: 13px;
  cursor: pointer;
  opacity: 0.6;
}
.chat-body {
  flex: 1;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.chat-footer {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-input-wrapper { display: flex; gap: 6px; }
.chat-input {
  flex: 1;
  background: rgba(44, 60, 71, 0.24);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}
.chat-input::placeholder { color: #2e4048; }
.chat-send-btn {
  width: 41px; height: 41px;
  background: #9a3fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-login-btn {
  background: #cffe1a;
  border-radius: 6px;
  padding: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #0e111a;
  cursor: pointer;
  text-align: center;
  width: 100%;
}
.chat-login-btn:hover { opacity: 0.9; }

.main-content {
  min-height: 100vh;
  overflow-y: auto;
  padding: 20px;
}

.game-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 16px;
}
.game-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}
.game-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.game-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px 6px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}
.free-badge {
  background: rgba(208, 255, 0, 0.08);
  color: #cffe1a;
  border: 1px solid rgba(208, 255, 0, 0.2);
}
.free-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #cffe1a;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(208, 255, 0, 0.6);
  animation: tagPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes tagPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(208, 255, 0, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 2px rgba(208, 255, 0, 0.3); }
}

.game-layout {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #0e111a;
  border: 1px solid #131a27;
  position: relative;
}
.game-layout-inner {
  display: flex;
  flex-direction: row;
  flex: 0 1 auto;
  min-width: 300px;
}

.bet-panel {
  width: 330px;
  min-width: 330px;
  max-width: 330px;
  background: #0e111a;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 1px solid #131a27;
}

.bet-tabs {
  display: flex;
  background: rgb(32, 35, 41);
  border-radius: 6px;
  padding: 6px 6px 0;
  gap: 3.2px;
  height: 48px;
}
.bet-tab {
  flex: 1;
  padding: 10px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #5a7080;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.bet-tab.active {
  background: linear-gradient(180deg, rgba(139, 44, 255, 0.15) 0%, rgba(139, 44, 255, 0.05) 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 44, 255, 0.15);
  border: 1px solid rgba(139, 44, 255, 0.2);
}
.bet-tab:hover:not(.active) {
  color: #8ba4ba;
  background: rgba(19, 26, 39, 0.5);
}

.bet-tab-content {
  display: none;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}
.bet-tab-content.active {
  display: flex;
}

.bet-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bet-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bet-label {
  font-size: 12px;
  font-weight: 700;
  color: #5a7080;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bet-balance {
  color: #cffe1a;
  font-weight: 800;
  font-size: 13px;
}

.bet-input-group {
  display: flex;
  align-items: center;
  background: rgba(19, 26, 39, 0.6);
  border: 1px solid #1c2740;
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.25s;
  height: 48px;
}
.bet-input-group:focus-within {
  border-color: rgba(139, 44, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 44, 255, 0.08);
}
.bet-currency {
  padding: 0 0 0 14px;
  color: #cffe1a;
  font-weight: 800;
  font-size: 14px;
}
.bet-input {
  flex: 1;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 10px;
  font-family: inherit;
  min-width: 0;
  -moz-appearance: textfield;
}
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bet-input-btn {
  padding: 10px 14px;
  color: #5a7080;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border-left: 1px solid #1c2740;
}
.bet-input-btn:hover {
  color: #cffe1a;
  background: rgba(207, 254, 26, 0.05);
}

.diff-buttons {
  display: flex;
  gap: 6px;
  height: 48px;
}
.diff-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #1c2740 0%, #151d30 100%);
  border: 1px solid #253350;
  border-radius: 5px;
  color: #5a7080;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  padding: 0 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}
.diff-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.diff-btn:hover {
  color: #8ba4ba;
  border-color: #354a6a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(21, 29, 48, 0.4);
}
.diff-btn:active { transform: translateY(0); }
.diff-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #8b2cff 0%, #6a1fd4 100%);
  border-color: #9d4aff;
  box-shadow: 0 4px 24px rgba(139, 44, 255, 0.3);
}
.diff-btn.active::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
}

.sidebet-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebet-info-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(19, 26, 39, 0.42);
  border: 1px solid #1c2740;
  border-radius: 6px;
}
.sidebet-info-card p {
  margin: 0;
  color: #5a7080;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.sidebet-title-row,
.sidebet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebet-note {
  color: #5a7080;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.sidebet-name {
  color: #dfe8f0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sidebet-name small {
  display: inline;
  color: #5a7080;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.sidebet-input-wrap {
  display: flex;
  align-items: center;
  width: 108px;
  height: 32px;
  background: rgba(19, 26, 39, 0.6);
  border: 1px solid #1c2740;
  border-radius: 5px;
  overflow: hidden;
}
.sidebet-input-wrap .bet-currency { padding-left: 10px; }
.sidebet-input {
  padding: 7px 8px;
  font-size: 12px;
}

.bj-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  order: -1;
}
.bj-action-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-radius: 6px;
  background: rgb(32, 35, 41);
  padding: 14px 16px;
  height: 54px;
  cursor: pointer;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 400;
  transition: transform 0.08s;
}
.bj-action-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.bj-action-btn:active:enabled {
  transform: scale(0.95);
  background: #4d5361;
}
.bj-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: #202329;
}
.bj-action-btn:hover:not(:disabled) img {
  opacity: 1;
}
.bj-cashout-btn {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #26313c 0%, #202329 100%);
  border: 1px solid rgba(206, 255, 92, 0.18);
}
.bj-cashout-btn strong {
  color: #ceff5c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.bj-cashout-btn:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(206, 255, 92, 0.08), 0 8px 22px rgba(0, 0, 0, 0.22);
}
.bj-cashout-btn:not(:disabled):hover {
  border-color: rgba(206, 255, 92, 0.42);
}

.bet-button {
  width: 100%;
  padding: 16px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
  background: linear-gradient(180deg, rgba(206, 255, 92, 1) 0%, rgba(208, 255, 0, 1) 100%);
  color: #0e111a;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 24px;
  height: 54px;
  min-height: 54px;
  position: relative;
  overflow: hidden;
}
.bet-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.bet-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(208, 255, 0, 0.25);
}
.bet-button:active { transform: translateY(0); }
.bet-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.3);
}

.cta-shuffle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #6c2bd9 0%, #8b2cff 50%, #a855f7 100%);
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 1px;
  height: 54px;
  min-height: 54px;
  position: relative;
  overflow: hidden;
}
.cta-shuffle-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.cta-shuffle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(139, 44, 255, 0.4);
}
.cta-shuffle-btn:active { transform: translateY(0); }
.cta-shuffle-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(10);
}

.game-board-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  height: 100%;
  background: #121418;
  border-radius: 0 8px 8px 0;
  position: relative;
  overflow: hidden;
}

.bj-table {
  position: relative;
  width: 100%;
  min-height: 544px;
  height: 592px;
  background-color: #121418;
  background-image: url('assets/background.svg');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: 176px;
  border-radius: 0 8px 0 0;
  overflow: visible;
  display: grid;
  grid-template-rows: 216px 216px;
  place-items: center;
  row-gap: 128px;
  padding: 16px 0;
  user-select: none;
}

.bj-dealer-area {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  row-gap: 16px;
  min-height: 160px;
  height: 160px;
  z-index: 2;
}

.bj-player-area {
  display: flex;
  width: 100%;
  justify-content: space-evenly;
  column-gap: 20px;
  position: relative;
  z-index: 2;
  height: 160px;
}
.bj-player-hand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 16px;
}
.bj-player-hand-wrap.hidden {
  display: none;
}
.bj-player-hand-wrap.active-hand .bj-score-badge {
  background: #08b9af;
  color: #080808;
}

.bj-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: width 0.2s;
}

.bj-card {
  position: relative;
  height: 8.25rem;
  aspect-ratio: 1 / 1.5;
  perspective: 50rem;
  flex-shrink: 0;
  z-index: 1;
}

.bj-card:first-child {
  margin-left: 0 !important;
}
.bj-card:not(:first-child) {
  margin-left: -40px;
}

.bj-card-front {
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1;
  border-radius: 0.375rem;
  box-shadow: 0 0 0.75rem 0 rgba(0,0,0,0.8);
  backface-visibility: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  border: 3px solid transparent;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  row-gap: 0.3rem;
  color: #000;
  transform: rotateY(-180deg);
}

.bj-card-back {
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1;
  border-radius: 0.375rem;
  box-shadow: 0 0 0.75rem 0 rgba(0,0,0,0.8);
  backface-visibility: hidden;
  transition: transform 0.3s ease;
  background: linear-gradient(123.69deg, #7717ff 50.04%, #680cec 50.06%);
  border: 1px solid #fff;
  transform: rotateY(0deg);
  display: grid;
  place-items: center;
}

.bj-card-back-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.bj-card-back-inner svg,
.bj-card-back-inner img {
  height: 18%;
  width: auto;
  max-width: 60%;
  object-fit: contain;
}

.bj-card.flipped .bj-card-front {
  transform: rotateY(0deg);
}
.bj-card.flipped .bj-card-back {
  transform: rotateY(180deg);
}

.bj-card-front span {
  font-family: 'Domine', 'Georgia', serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 0.8;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.bj-card-front svg {
  width: 30%;
  height: auto;
}

.bj-card-red {
  color: #b4171e;
}
.bj-card-black {
  color: #000;
}

.bj-card-front.card-win { border-color: #3dd179; }
.bj-card-front.card-push { border-color: #ff774a; }
.bj-card-front.card-lose { border-color: #f1323e; }
.bj-card-front.card-playing { border-color: #08b9af; }

.bj-card.exiting {
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  transform: translate(-20px, 20px);
  opacity: 0;
}

.bj-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #343843;
  border-radius: 255px;
  font-weight: 700;
  font-size: 0.825rem;
  padding: 0.2rem 1.2rem;
  line-height: 1.5;
  color: #fff;
  transition: all 0.3s;
  visibility: hidden;
  white-space: nowrap;
}
.bj-score-badge.visible {
  visibility: visible;
}

.bj-score-badge.blackjack,
.bj-score-badge.win {
  background: #3dd179;
  color: #080808;
}
.bj-score-badge.bust {
  background: #f1323e;
  color: #fff;
}
.bj-score-badge.push {
  background: #ff774a;
  color: #080808;
}

.bj-ribbon {
  display: none;
}

.bj-deck {
  position: absolute;
  right: 21px;
  top: 16px;
  transform: scale(0.5);
  transform-origin: top right;
  z-index: 3;
}

.bj-deck-inner {
  position: relative;
  width: 0;
  height: 0;
}

.bj-deck-card {
  position: absolute;
  width: 166.656px;
  height: 250px;
  aspect-ratio: 1 / 1.5;
  border-radius: 6px;
  background: linear-gradient(123.69deg, #7717ff 50.04%, #680cec 50.06%);
  border: 1px solid #fff;
  box-shadow: 0 2px 3px rgba(0,0,0,0.25);
  backface-visibility: hidden;
  perspective: 1600px;
}

.bj-deck-card:nth-child(1) { top: 0; }
.bj-deck-card:nth-child(2) { top: 6px; }
.bj-deck-card:nth-child(3) { top: 12px; }
.bj-deck-card:nth-child(4) { top: 18px; }

.bj-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(3px);
  border-radius: 0 8px 0 0;
}
.bj-result-overlay.visible {
  display: flex;
  animation: bjFadeIn 0.3s ease;
}
.bj-result-overlay.hidden {
  display: none;
}
@keyframes bjFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.bj-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: bjResultPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bjResultPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.bj-result-text {
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.bj-result-text.win { color: #34e071; }
.bj-result-text.lose { color: #f1323e; }
.bj-result-text.push { color: #ffc107; }
.bj-result-text.blackjack {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 40px;
}
.bj-result-amount {
  font-size: 22px;
  font-weight: 700;
}
.bj-result-amount.win { color: #34e071; }
.bj-result-amount.lose { color: #f1323e; }
.bj-result-amount.push { color: #ffc107; }

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  background: #0e111a;
  border-radius: 0 0 8px 0;
}
.game-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.game-footer-center {
  display: flex;
  align-items: center;
}
.game-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8ba4ba;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
}
.footer-icon-btn:hover { background: #131a27; color: #fff; }
.footer-brand-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  display: block;
  opacity: 0.85;
}
.footer-fairness {
  font-size: 12px;
  color: #cffe1a;
  font-weight: 700;
}
.demo-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid #1c2740;
  cursor: pointer;
  user-select: none;
}
.demo-mode-toggle input { display: none; }
.demo-mode-track {
  width: 34px;
  height: 18px;
  padding: 2px;
  border-radius: 999px;
  background: #1a2334;
  border: 1px solid #27344d;
  transition: background 0.2s, border-color 0.2s;
}
.demo-mode-thumb {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8ba4ba;
  transition: transform 0.2s, background 0.2s;
}
.demo-mode-toggle input:checked + .demo-mode-track {
  background: rgba(208, 255, 0, 0.14);
  border-color: rgba(208, 255, 0, 0.42);
}
.demo-mode-toggle input:checked + .demo-mode-track .demo-mode-thumb {
  transform: translateX(16px);
  background: #cffe1a;
}
.demo-mode-label {
  color: #8ba4ba;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.demo-mode-toggle input:checked ~ .demo-mode-label { color: #cffe1a; }
.demo-cash-control {
  display: none;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  padding: 5px 8px;
  border: 1px solid #1c2740;
  border-radius: 7px;
  background: rgba(19, 26, 39, 0.55);
}
.demo-cash-control.visible { display: inline-flex; }
.demo-cash-name {
  color: #8ba4ba;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.demo-cash-control input {
  width: 92px;
  border: 0;
  outline: none;
  background: transparent;
  color: #cffe1a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}
.demo-cash-control input::-webkit-outer-spin-button,
.demo-cash-control input::-webkit-inner-spin-button { margin: 0; }
.demo-cash-note {
  color: #5a7080;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.game-history {
  margin-top: 56px;
  background: #0e111a;
  border: 1px solid #131a27;
  border-radius: 8px;
  overflow: hidden;
  padding: 24px;
}
.history-tabs-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}
.history-tabs {
  display: flex;
  background: #131a27;
  border-radius: 5px;
  padding: 4px;
  gap: 4px;
}
.history-tab {
  flex: 1;
  padding: 10px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #5a7080;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.history-tab.active {
  background: linear-gradient(180deg, rgba(139, 44, 255, 0.15) 0%, rgba(139, 44, 255, 0.05) 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 44, 255, 0.15);
  border: 1px solid rgba(139, 44, 255, 0.2);
}
.history-tab:hover:not(.active) {
  color: #8ba4ba;
  background: rgba(19, 26, 39, 0.5);
}
.history-count-select {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}
.history-count-select select {
  background: rgba(19, 26, 39, 0.6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 10px 36px 10px 16px;
  border-radius: 5px;
  border: 1px solid #1c2740;
  cursor: pointer;
  appearance: none;
  outline: none;
}
.history-count-select select option { background: #0e111a; color: #fff; }
.history-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5a7080;
  pointer-events: none;
}
.history-table-wrap { overflow-x: auto; }
.history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.history-table thead { border-bottom: 1px solid #1c2740; }
.history-table th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #5a7080;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.history-table th:last-child { text-align: right; }
.history-table td {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(28, 39, 64, 0.4);
  vertical-align: middle;
}
.history-table td:last-child { text-align: right; }
.history-table tbody tr { min-height: 54px; transition: background 0.15s; }
.history-table tbody tr:hover { background: rgba(139, 44, 255, 0.03); }
.history-empty {
  color: #5a7080;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 40px 16px;
}
.history-empty-row td { border-bottom: none !important; }
.history-table .td-win { color: #cffe1a; }
.history-table .td-loss { color: #f1323e; }
.history-table .td-push { color: #5a7080; }
.td-game { display: flex; align-items: center; gap: 8px; }
.td-game-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8b2cff, #cffe1a);
  box-shadow: 0 0 12px rgba(139, 44, 255, 0.22);
}
.history-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(207, 254, 26, 0.25);
}
.history-user-name {
  display: block;
  color: #5a7080;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-cards {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-card-group {
  display: inline-flex;
  align-items: center;
}
.history-card-mini {
  width: 24px;
  height: 34px;
  border-radius: 4px;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Domine', 'Georgia', serif;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.35);
}
.history-card-mini:not(:first-child) { margin-left: -8px; }
.history-card-mini.red { color: #b4171e; }
.history-card-mini.black { color: #000; }
.history-card-sep { color: #5a7080; font-size: 12px; font-weight: 900; }
.history-code {
  display: block;
  color: #8ba4ba;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }

.bj-table > .bj-dealer-area { align-self: end; }
.bj-table > .bj-player-area { align-self: start; }

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background: #121418;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (max-width: 1400px) {
  .app-layout {
    grid-template-columns: 236px 1fr;
  }
  .chat-sidebar {
    display: none;
  }
}

@media (max-width: 1100px) {
  .game-layout-inner {
    flex-direction: column;
  }
  .bet-panel {
    width: 100%;
    min-width: unset;
    max-width: unset;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .bet-tabs {
    width: 100%;
  }
  .bet-tab-content {
    width: 100%;
    margin-top: 12px;
  }
  .bet-tab-content.active {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .bet-field {
    flex: 1;
    min-width: 200px;
  }
  .bet-button {
    width: 100%;
    margin-top: 12px;
  }
  .bj-table {
    min-height: 480px;
    height: auto;
    grid-template-rows: 180px 180px;
    row-gap: 80px;
  }
  .bj-card {
    height: 7.8rem;
  }
  .bj-card:not(:first-child) {
    margin-left: -40px;
  }
  .bj-dealer-area {
    min-height: 140px;
    height: 140px;
  }
  .bj-player-area {
    height: 140px;
  }
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    transition: left 0.3s ease;
    z-index: 150;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: flex; }
  .main-content { padding: 70px 20px 12px; }
}

@media (max-width: 900px) {
  .bj-table { min-height: 380px; height: auto; grid-template-rows: 150px 150px; row-gap: 60px; }
  .bet-panel { padding: 12px; }
  .bj-card {
    height: 6.6rem;
  }
  .bj-card:not(:first-child) {
    margin-left: -35px;
  }
  .bj-card-front span { font-size: 1.6rem; }
  .bj-deck { right: 48px; top: 20px; }
  .bj-dealer-area { min-height: 120px; height: 120px; }
  .bj-player-area { height: 120px; }
}

@media (max-width: 600px) {
  .bet-tab-content.active {
    flex-direction: column;
  }
  .bet-field {
    min-width: unset;
  }
  .bj-table { min-height: 300px; height: auto; grid-template-rows: 120px 120px; row-gap: 40px; }
  .bj-card {
    height: 5.6rem;
  }
  .bj-card:not(:first-child) {
    margin-left: -28px;
  }
  .bj-card-front span { font-size: 1.3rem; }
  .bj-deck { top: 10px; right: 16px; transform: scale(0.35); transform-origin: top right; }
  .bj-dealer-area { min-height: 100px; height: 100px; row-gap: 8px; }
  .bj-player-area { height: 100px; }
}

.mobile-game-fullscreen .bet-panel {
  order: 2;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  background: rgba(14, 17, 26, 0.95) !important;
  border: none !important;
  border-top: 1px solid #1c2740 !important;
  padding: 6px 10px !important;
  flex-direction: column !important;
  gap: 0 !important;
}

.mobile-game-fullscreen .bet-panel .bet-tabs {
  display: none !important;
}

.mobile-game-fullscreen .bet-tab-content {
  margin-top: 0 !important;
  gap: 0 !important;
}

.mobile-game-fullscreen .bet-tab-content .bet-field,
.mobile-game-fullscreen .bet-tab-content .bet-button,
.mobile-game-fullscreen .bet-tab-content .cta-shuffle-btn {
  display: none !important;
}

.mobile-game-fullscreen #standardContent {
  display: flex !important;
}

.mobile-game-fullscreen .bj-actions {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px;
  order: -1;
}

.mobile-game-fullscreen .bj-action-btn {
  height: 44px;
  padding: 8px 6px;
  font-size: 12px;
  border-radius: 8px;
}

.mobile-game-fullscreen .bj-action-btn img {
  width: 16px;
  height: 16px;
}

.mobile-game-fullscreen .bj-table {
  height: 100% !important;
  min-height: 0 !important;
  grid-template-rows: 1fr 1fr !important;
  row-gap: 16px !important;
  padding: 8px 0 !important;
}

.mobile-game-fullscreen .bj-dealer-area,
.mobile-game-fullscreen .bj-player-area {
  min-height: 0 !important;
  height: auto !important;
}

.mobile-game-fullscreen .bj-card {
  height: 7rem;
}

.mobile-game-fullscreen .bj-card:not(:first-child) {
  margin-left: -32px;
}

.mobile-game-fullscreen .bj-card-front span {
  font-size: 1.5rem;
}

.mobile-game-fullscreen .bj-deck {
  top: 8px;
  right: 12px;
  transform: scale(0.3);
}

.mobile-game-fullscreen .bj-result-overlay {
  z-index: 60;
}

.mobile-game-fullscreen .bj-result-text {
  font-size: 28px;
}

.mobile-game-fullscreen .bj-result-amount {
  font-size: 20px;
}

/* Speed toggle */
.footer-speed-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  color: #8ba4ba;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  background: none;
  border: none;
}
.footer-speed-btn:hover { background: #131a27; color: #fff; }
.footer-speed-btn.active { color: #cffe1a; }
.speed-label { font-size: 12px; font-weight: 700; }
.speed-gauge { overflow: hidden; display: block; }
#speedNeedle { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
