/**/
/* THIS FILE AUTOGENERATED FROM CSS in ./web/css/ */ 
/**/
/* ==========================================================================
   Classic Backgammon - Scoped Saito Game Styles (Explicit px units)
   All rules are strictly scoped to html.game.backgammon / #backgammon-saito-mount
   so attaching Backgammon stylesheets in Arcade or RedSquare never affects global DOM.
   ========================================================================== */

@font-face {
  font-family: 'flashrogersstraight';
  src:
    url('/backgammon/css/flashrogersstraight.woff2') format('woff2'),
    url('/backgammon/css/flashrogersstraight.woff') format('woff'),
    url('/backgammon/css/flashrogersstraight.svg#flashrogersstraight') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   1. Splash / Entry Page Mode (/backgammon when no game is active)
   -------------------------------------------------------------------------- */
html.game.backgammon #game-loader-screen,
html.game.backgammon #saito-loader-container {
  display: none !important;
}

html.game.backgammon body:not(.backgammon-in-game) {
  overflow-y: auto;
}

html.game.backgammon body:not(.backgammon-in-game) .scrollable-page {
  height: 100vh;
  width: 100vw;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--saito-header-height, 70px);
  background: radial-gradient(circle at 50% 0%, #3b1e0e 0%, #1c0d06 65%, #0c0502 100%);
  color: #f9f3eb;
}

html.game.backgammon body:not(.backgammon-in-game) .saito-splash-section-title h1,
html.game.backgammon body:not(.backgammon-in-game) .saito-splash-section-title h2,
html.game.backgammon body:not(.backgammon-in-game) .saito-splash-section-title h3,
html.game.backgammon body:not(.backgammon-in-game) .splash-page-game-introduction {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.9);
}

html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav {
  background-image: none !important;
  background-color: transparent !important;
}

@media (min-width: 601px) {
  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 50% !important;
    bottom: auto !important;
    left: 0 !important;
    transform: translateY(-50%) !important;
    z-index: 45 !important;
  }
}

html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul li a {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
}

html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul li:has(#create-game-button),
html.game.backgammon body:not(.backgammon-in-game) #create-game-button,
html.game.backgammon body:not(.backgammon-in-game) #create-game-button-mobile,
html.game.backgammon body:not(.backgammon-in-game) #mobile-anchor {
  display: none !important;
}

.arcade-game-info .leaderboard {
  padding-top: 28px !important;
}

@media (max-width: 600px) {
  html.game.backgammon body:not(.backgammon-in-game) .scrollable-page {
    padding-top: calc(var(--saito-header-height, 70px) + 44px) !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav {
    display: block !important;
    position: fixed !important;
    top: var(--saito-header-height, 70px) !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 40 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 6px 10px !important;
    background: rgba(20, 9, 4, 0.92) !important;
    border-bottom: 1px solid rgba(226, 179, 98, 0.35) !important;
    backdrop-filter: blur(8px) !important;
    box-sizing: border-box !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul li {
    width: auto !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul li:has(#create-game-button) {
    display: none !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) .saito-splash-nav ul li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    background: rgba(226, 179, 98, 0.16) !important;
    border: 1px solid rgba(226, 179, 98, 0.45) !important;
    color: #ffe29a !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    text-decoration: none !important;
  }

  html.game.backgammon body:not(.backgammon-in-game) #create-game-button-mobile {
    bottom: 64px !important;
    right: 16px !important;
    z-index: 60 !important;
  }
}

/* --------------------------------------------------------------------------
   2. Active In-Game Mode (body.backgammon-in-game)
   -------------------------------------------------------------------------- */
html.game.backgammon body.backgammon-in-game {
  background-color: #160803 !important;
  background-image: radial-gradient(circle at 50% 50%, #3b1909 0%, #1c0b04 75%, #0f0501 100%) !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

#backgammon-saito-mount .orientation-msg-container,
#backgammon-saito-mount #block_game {
  display: none !important;
  pointer-events: none !important;
}

html.game.backgammon body.backgammon-in-game .scrollable-page,
html.game.backgammon body.backgammon-in-game .saito-splash-image,
html.game.backgammon body.backgammon-in-game .saito-splash-nav,
html.game.backgammon body.backgammon-in-game .footer,
html.game.backgammon body.backgammon-in-game #game-loader-screen,
html.game.backgammon body.backgammon-in-game #saito-loader-container {
  display: none !important;
}

#backgammon-saito-mount,
#backgammon-saito-mount * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#backgammon-saito-mount #canvas {
  position: fixed;
  image-rendering: optimizeSpeed;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
  -ms-touch-action: none;
  touch-action: none;
}

#backgammon-saito-mount .ani_hack {
  -webkit-perspective: 1000;
  -webkit-backface-visibility: hidden;
  -webkit-touch-callout: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#backgammon-saito-mount .check-fonts {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

#backgammon-saito-mount .check-font-1 {
  font-family: 'flashrogersstraight';
}

/* --------------------------------------------------------------------------
   3. Top-Left Saito Game Menu & Top-Right Wallet Hamburger (In-Game)
   -------------------------------------------------------------------------- */
html.game.backgammon #game-share,
html.game.backgammon body.backgammon-in-game #game-menu-toggle,
html.game.backgammon body.backgammon-in-game .game-menu-mobile-toggle,
html.game.backgammon body.backgammon-in-game .game-menu-mobile-header,
html.game.backgammon body.backgammon-in-game #game-menu-fullscreen,
html.game.backgammon body.backgammon-in-game #game-debug,
html.game.backgammon body.backgammon-in-game .game-debug,
html.game.backgammon body.backgammon-in-game #game-export,
html.game.backgammon body.backgammon-in-game .game-export,
html.game.backgammon body.backgammon-in-game .game-menu:not(:has(#game-game)),
html.game.backgammon body.backgammon-in-game .game-menu > ul:not(:has(#game-game)) {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game #saito-header,
html.game.backgammon body.backgammon-in-game #saito-header.game {
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  z-index: 650 !important;
}

html.game.backgammon body.backgammon-in-game #saito-header:has(.saito-header-hamburger-contents.show-menu),
html.game.backgammon body.backgammon-in-game #saito-header.game:has(.saito-header-hamburger-contents.show-menu) {
  z-index: 3200 !important;
}

html.game.backgammon body.backgammon-in-game #saito-header .saito-header-logo-wrapper,
html.game.backgammon body.backgammon-in-game #saito-header #header-msg,
html.game.backgammon body.backgammon-in-game #saito-header.game .saito-header-logo-wrapper,
html.game.backgammon body.backgammon-in-game #saito-header.game #header-msg {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game #saito-header .hamburger-container,
html.game.backgammon body.backgammon-in-game #saito-header #saito-header-menu-toggle,
html.game.backgammon body.backgammon-in-game #saito-header .saito-header-hamburger-contents,
html.game.backgammon body.backgammon-in-game #saito-header.game .hamburger-container,
html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle,
html.game.backgammon body.backgammon-in-game #saito-header.game .saito-header-hamburger-contents,
html.game.backgammon body.backgammon-in-game .game-menu,
html.game.backgammon body.backgammon-in-game .game-menu * {
  pointer-events: auto !important;
}

html.game.backgammon body.backgammon-in-game .game-menu {
  position: fixed !important;
  top: 8px !important;
  left: 10px !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 650 !important;
  font-size: 14px !important;
  color: #fff6e8 !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 4px !important;
  transform: none !important;
  overflow: visible !important;
  background: linear-gradient(180deg, rgba(62, 31, 14, 0.95) 0%, rgba(32, 15, 6, 0.97) 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option,
html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  min-width: 68px !important;
  max-width: 140px !important;
  width: auto !important;
  height: 34px !important;
  line-height: 34px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  color: #fff6e8 !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
  min-width: 36px !important;
  width: 36px !important;
  max-width: 36px !important;
  padding: 0 4px !important;
  line-height: 34px !important;
  font-size: 0 !important;
  color: transparent !important;
  overflow: hidden !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon::before,
html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon i {
  font-size: 15px !important;
  color: #fff6e8 !important;
  line-height: 34px !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li:hover {
  background-color: rgba(226, 179, 98, 0.22) !important;
  color: #ffe29a !important;
}

html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options,
html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-sub-options {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  min-width: 215px !important;
  width: max-content !important;
  max-height: none !important;
  overflow: visible !important;
  background: rgba(34, 16, 7, 0.98) !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85) !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 660 !important;
}

html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options::before,
html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-sub-options::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: transparent;
  pointer-events: auto;
}

html.game.backgammon body.backgammon-in-game .game-menu.mobile-saito-visible > ul > .game-menu-icon,
html.game.backgammon body.backgammon-in-game .game-menu.mobile-saito-visible > ul > .game-menu-option {
  visibility: visible !important;
}

html.game.backgammon body.backgammon-in-game .game-menu.mobile-saito-visible {
  transform: none !important;
  pointer-events: auto !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option > .game-menu-option-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  height: 100% !important;
  min-height: 0 !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}

html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option .game-menu-accordion-icon {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options li {
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  padding: 8px 14px !important;
  line-height: 1.35 !important;
  height: auto !important;
  min-height: 0 !important;
  font-size: 13.5px !important;
  color: #fff6e8 !important;
  border-bottom: 1px solid rgba(226, 179, 98, 0.2) !important;
  text-align: left !important;
  cursor: pointer !important;
}

html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options .game-menu-option-label,
html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options .game-menu-option-label span {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.35 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}

html.game.backgammon body.backgammon-in-game .game-menu ul.game-menu-sub-options li:last-child {
  border-bottom: none;
}

html.game.backgammon body.backgammon-in-game .game-menu-sub-option:hover,
html.game.backgammon body.backgammon-in-game .game-menu-sub-sub-option:hover {
  background-color: rgba(226, 179, 98, 0.25);
  color: #ffe29a;
}

html.game.backgammon body.backgammon-in-game #saito-header .hamburger-container,
html.game.backgammon body.backgammon-in-game #saito-header.game .hamburger-container {
  position: fixed !important;
  top: 8px !important;
  right: 10px !important;
  z-index: 3210 !important;
  margin: 0 !important;
}

html.game.backgammon body.backgammon-in-game #saito-header #saito-header-menu-toggle,
html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  background: linear-gradient(180deg, rgba(62, 31, 14, 0.95) 0%, rgba(32, 15, 6, 0.97) 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
  color: #fff6e8 !important;
  cursor: pointer !important;
}

html.game.backgammon body.backgammon-in-game #saito-header #saito-header-menu-toggle i,
html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle .fa-bars {
  border: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
  width: auto !important;
  height: auto !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: #fff6e8 !important;
}

html.game.backgammon body.backgammon-in-game #saito-header #saito-header-menu-toggle:hover,
html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle:hover {
  border-color: #ffe29a !important;
  color: #ffe29a !important;
}

/* --------------------------------------------------------------------------
   4. Bottom Saito Game Over & Active Turn HUD Bar
   -------------------------------------------------------------------------- */
html.game.backgammon body.backgammon-in-game #hud,
html.game.backgammon body.backgammon-in-game #game-hud2,
html.game.backgammon body.backgammon-in-game .game-hud2,
html.game.backgammon body.backgammon-in-game .hud {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: 12px !important;
  left: 50% !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  min-width: min(460px, 92vw) !important;
  max-width: 94vw !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 10px 16px !important;
  background: linear-gradient(180deg, rgba(56, 27, 11, 0.96) 0%, rgba(28, 13, 5, 0.98) 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.75) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85) !important;
  z-index: 600 !important;
  pointer-events: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
}

html.game.backgammon body.backgammon-in-game #hud.bg-turn-hud,
html.game.backgammon body.backgammon-in-game #game-hud2.bg-turn-hud,
html.game.backgammon body.backgammon-in-game .game-hud2.bg-turn-hud,
html.game.backgammon body.backgammon-in-game .hud.bg-turn-hud,
html.game.backgammon body.backgammon-in-game #hud:not(:has(.hud-menu li)),
html.game.backgammon body.backgammon-in-game #game-hud2:not(:has(.hud-menu li)),
html.game.backgammon body.backgammon-in-game .game-hud2:not(:has(.hud-menu li)),
html.game.backgammon body.backgammon-in-game .hud:not(:has(.hud-menu li)) {
  bottom: 8px !important;
  width: max-content !important;
  min-width: 0 !important;
  padding: 5px 18px !important;
  border-radius: 999px !important;
  pointer-events: auto !important;
  z-index: 480 !important;
  gap: 0 !important;
}

html.game.backgammon body.backgammon-in-game #hud.bg-turn-hud .hud-menu,
html.game.backgammon body.backgammon-in-game #game-hud2.bg-turn-hud .hud-menu,
html.game.backgammon body.backgammon-in-game .game-hud2.bg-turn-hud .hud-menu,
html.game.backgammon body.backgammon-in-game .hud.bg-turn-hud .hud-menu,
html.game.backgammon body.backgammon-in-game #hud:not(:has(.hud-menu li)) .hud-menu,
html.game.backgammon body.backgammon-in-game #game-hud2:not(:has(.hud-menu li)) .hud-menu,
html.game.backgammon body.backgammon-in-game .game-hud2:not(:has(.hud-menu li)) .hud-menu,
html.game.backgammon body.backgammon-in-game .hud:not(:has(.hud-menu li)) .hud-menu {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game #hud .hud-header,
html.game.backgammon body.backgammon-in-game #game-hud2 .hud-header,
html.game.backgammon body.backgammon-in-game .game-hud2 .hud-header,
html.game.backgammon body.backgammon-in-game .hud-header {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game #hud .hud-status-row,
html.game.backgammon body.backgammon-in-game #game-hud2 .hud-status-row,
html.game.backgammon body.backgammon-in-game .game-hud2 .hud-status-row,
html.game.backgammon body.backgammon-in-game .hud-status-row {
  width: 100% !important;
  cursor: default !important;
}

html.game.backgammon body.backgammon-in-game #hud .hud-status,
html.game.backgammon body.backgammon-in-game #hud .status,
html.game.backgammon body.backgammon-in-game #game-hud2 .hud-status,
html.game.backgammon body.backgammon-in-game .game-hud2 .hud-status,
html.game.backgammon body.backgammon-in-game .hud-status,
html.game.backgammon body.backgammon-in-game .hud .status {
  background: transparent !important;
  box-shadow: none !important;
  color: #ffe29a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  text-align: center !important;
}

html.game.backgammon body.backgammon-in-game .hud-menu,
html.game.backgammon body.backgammon-in-game .hud .controls {
  background: transparent !important;
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
}

html.game.backgammon body.backgammon-in-game .hud-menu ul,
html.game.backgammon body.backgammon-in-game .hud .controls ul {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.game.backgammon body.backgammon-in-game .hud-menu li,
html.game.backgammon body.backgammon-in-game .hud-menu .option,
html.game.backgammon body.backgammon-in-game .hud .controls li,
html.game.backgammon body.backgammon-in-game .hud .controls .option {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 155px !important;
  max-width: 260px !important;
  height: auto !important;
  min-height: 38px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  padding: 8px 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #6e3717 0%, #3d1c09 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  border-radius: 8px !important;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease !important;
}

html.game.backgammon body.backgammon-in-game .hud-menu li:hover,
html.game.backgammon body.backgammon-in-game .hud-menu .option:hover,
html.game.backgammon body.backgammon-in-game .hud .controls li:hover,
html.game.backgammon body.backgammon-in-game .hud .controls .option:hover {
  background: linear-gradient(180deg, #8b461e 0%, #52260d 100%) !important;
  border-color: #ffe29a !important;
  color: #ffe29a !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5. Live Top-Center Turn & Dice Status Pill (#bg-turn-pill)
   -------------------------------------------------------------------------- */
#backgammon-saito-mount #bg-turn-pill {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 440;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(52, 25, 11, 0.95) 0%, rgba(26, 12, 5, 0.97) 100%);
  border: 1px solid rgba(226, 179, 98, 0.6);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  color: #f8f2e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#backgammon-saito-mount #bg-turn-pill.is-my-turn {
  border-color: rgba(74, 222, 128, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 14px rgba(74, 222, 128, 0.28);
}

#backgammon-saito-mount .bg-turn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8947e;
  flex-shrink: 0;
}

#backgammon-saito-mount .bg-turn-dot.active {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

#backgammon-saito-mount .bg-turn-player-badge {
  font-weight: 700;
  color: #ffe29a;
  font-size: 12px;
}

#backgammon-saito-mount .bg-turn-sep {
  color: rgba(226, 179, 98, 0.45);
  font-size: 12px;
}

#backgammon-saito-mount .bg-turn-status-text {
  font-weight: 600;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.2px;
}

#backgammon-saito-mount #bg-turn-pill.is-my-turn .bg-turn-status-text {
  color: #86efac;
  font-weight: 700;
}

#backgammon-saito-mount .bg-player-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(226, 179, 98, 0.32);
  font-size: 11px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#backgammon-saito-mount .bg-player-score-chip.active-turn {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.78);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.22);
}

#backgammon-saito-mount .bg-checker-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

#backgammon-saito-mount .bg-checker-dot.is-white {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #eae0d0 70%, #b8a890 100%);
  border: 1.5px solid #c8a25a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#backgammon-saito-mount .bg-checker-dot.is-red {
  background: radial-gradient(circle at 35% 35%, #f87171 0%, #dc2626 65%, #7f1d1d 100%);
  border: 1.5px solid #fca5a5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#backgammon-saito-mount .bg-score-name {
  font-weight: 700;
  color: #fff6e8;
  font-size: 11px;
}

#backgammon-saito-mount .bg-player-score-chip.is-you .bg-score-name {
  color: #ffe29a;
}

#backgammon-saito-mount .bg-pip-badge {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(226, 179, 98, 0.18);
  color: #ffe29a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 10.5px;
}

#backgammon-saito-mount .bg-off-badge {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #d6c5b3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 10px;
}

#backgammon-saito-mount .bg-turn-dice-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(226, 179, 98, 0.22);
  border: 1px solid rgba(226, 179, 98, 0.55);
  color: #ffe29a;
  font-weight: 700;
  font-size: 11px;
}

#backgammon-saito-mount .bg-turn-clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(226, 179, 98, 0.45);
}

#backgammon-saito-mount .bg-turn-clock-text {
  color: #ffe29a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 11px;
}

#backgammon-saito-mount .bg-turn-clock-text.is-warning {
  color: #fbbf24;
}

#backgammon-saito-mount .bg-turn-clock-text.is-danger {
  color: #f87171;
  animation: bgClockPulse 0.7s ease-in-out infinite alternate;
}

@keyframes bgClockPulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.45;
  }
}

html.game.backgammon body.backgammon-in-game #game-clock {
  display: none !important;
}

#backgammon-saito-mount .bg-stake-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.45) 0%, rgba(20, 83, 45, 0.65) 100%);
  border: 1px solid rgba(74, 222, 128, 0.65);
  color: #bbf7d0;
  font-weight: 700;
  font-size: 11px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

#backgammon-saito-mount .bg-stake-chip:hover {
  border-color: #86efac;
  transform: translateY(-1px);
}

@media (max-width: 1180px) and (min-height: 501px) {
  #backgammon-saito-mount #bg-turn-pill {
    top: 52px;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 840px) {
  #backgammon-saito-mount .bg-off-badge {
    display: none;
  }
}

html.game.backgammon body.backgammon-in-game .game-menu #game-social > ul,
html.game.backgammon body.backgammon-in-game .game-menu .game-social > ul {
  display: none !important;
}

@media screen and (max-width: 960px) and (orientation: landscape), screen and (max-height: 550px) {
  html.game.backgammon body.backgammon-in-game #hud.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game #game-hud2.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game .game-hud2.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game .hud.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game #hud:not(.bg-gameover-hud):not(:has(.hud-menu li)),
  html.game.backgammon body.backgammon-in-game #game-hud2:not(.bg-gameover-hud):not(:has(.hud-menu li)),
  html.game.backgammon body.backgammon-in-game .game-hud2:not(.bg-gameover-hud):not(:has(.hud-menu li)),
  html.game.backgammon body.backgammon-in-game .hud:not(.bg-gameover-hud):not(:has(.hud-menu li)) {
    display: none !important;
  }
}

@media screen and (max-width: 960px), screen and (max-height: 550px) {
  #backgammon-saito-mount .bg-player-score-chip,
  #backgammon-saito-mount .bg-turn-player-badge,
  #backgammon-saito-mount .bg-turn-sep,
  #backgammon-saito-mount .bg-off-badge,
  #backgammon-saito-mount .bg-pip-badge,
  #backgammon-saito-mount #bg-turn-dice-chip,
  #backgammon-saito-mount #bg-stake-chip,
  #backgammon-saito-mount .bg-stake-chip {
    display: none !important;
  }
}

@media (max-width: 640px) and (min-height: 501px) {
  html.game.backgammon body.backgammon-in-game .game-menu {
    left: 8px !important;
    top: 8px !important;
    font-size: 13px !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option {
    min-width: 52px !important;
    padding: 0 7px !important;
  }

  #backgammon-saito-mount #bg-turn-pill {
    top: 13px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: max-content !important;
    max-width: calc(100vw - 180px) !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 9px !important;
    border-radius: 999px !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 5px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }

  #backgammon-saito-mount .bg-turn-player-badge,
  #backgammon-saito-mount .bg-turn-sep {
    display: none !important;
  }

  html.game.backgammon body.backgammon-in-game #hud.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game #game-hud2.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game .game-hud2.bg-turn-hud,
  html.game.backgammon body.backgammon-in-game .hud.bg-turn-hud {
    display: flex !important;
    bottom: 24px !important;
    pointer-events: auto !important;
  }
}

@media (max-height: 500px) {
  html.game.backgammon body.backgammon-in-game .game-menu {
    top: 4px !important;
    left: 8px !important;
    font-size: 12px !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul {
    height: 28px !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 3px !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
    flex: 0 0 auto !important;
    height: 24px !important;
    line-height: 24px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 5px !important;
    margin: 0 !important;
    font-size: 11px !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option::after,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option i {
    display: none !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option > span,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option > a {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
    min-width: 26px !important;
    width: 26px !important;
    max-width: 26px !important;
    padding: 0 2px !important;
    font-size: 0 !important;
    color: transparent !important;
  }

  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon::before,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon i {
    font-size: 13px !important;
    line-height: 24px !important;
  }

  html.game.backgammon body.backgammon-in-game #saito-header.game .hamburger-container {
    top: 4px !important;
    right: 8px !important;
  }

  html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle {
    width: 28px !important;
    height: 28px !important;
  }

  #backgammon-saito-mount #bg-turn-pill {
    top: 4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    height: 20px !important;
    min-height: 20px !important;
    padding: 0 8px !important;
    gap: 5px !important;
    font-size: 9.5px !important;
    white-space: nowrap !important;
  }

  #backgammon-saito-mount .bg-turn-clock-wrap,
  #backgammon-saito-mount .bg-turn-clock-text,
  #backgammon-saito-mount .bg-stake-chip {
    padding: 1px 6px !important;
    font-size: 10px !important;
  }

  #backgammon-saito-mount .bg-player-score-chip,
  #backgammon-saito-mount .bg-turn-player-badge,
  #backgammon-saito-mount .bg-turn-sep,
  #backgammon-saito-mount .bg-off-badge {
    display: none !important;
  }

  #backgammon-saito-mount #bg-pf-pill {
    bottom: 4px !important;
    left: 8px !important;
    height: 26px !important;
    padding: 0 9px !important;
    font-size: 10px !important;
  }
}

/* --------------------------------------------------------------------------
   6. Provably Fair Live Dice HUD Pill & SHA-256 Audit Modal
   -------------------------------------------------------------------------- */
#backgammon-saito-mount #bg-pf-pill {
  display: none !important;
}

#backgammon-saito-mount .bg-pf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3500 !important;
  background: rgba(5, 3, 2, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html.game.backgammon body.backgammon-in-game .site-message-wrapper,
html.game.backgammon body.backgammon-in-game #site-message-wrapper {
  position: fixed !important;
  bottom: 62px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  max-width: min(380px, 90vw) !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(56, 27, 11, 0.96) 0%, rgba(28, 13, 5, 0.98) 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85) !important;
  color: #fff6e8 !important;
  z-index: 2500 !important;
  pointer-events: auto !important;
}

#backgammon-saito-mount .bg-pf-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #241208 0%, #140904 100%);
  border: 1px solid rgba(226, 179, 98, 0.65);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.9);
  color: #f8f2e9;
  overflow: hidden;
}

#backgammon-saito-mount .bg-pf-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 179, 98, 0.25);
  background: rgba(0, 0, 0, 0.25);
}

#backgammon-saito-mount .bg-pf-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffe29a;
  margin-bottom: 2px;
}

#backgammon-saito-mount .bg-pf-modal-subtitle {
  font-size: 11px;
  color: #d6c5b3;
  line-height: 1.35;
}

#backgammon-saito-mount .bg-pf-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(226, 179, 98, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff6e8;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

#backgammon-saito-mount .bg-pf-close-btn:hover {
  background: rgba(226, 179, 98, 0.22);
  color: #ffe29a;
}

#backgammon-saito-mount .bg-pf-modal-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#backgammon-saito-mount .bg-pf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#backgammon-saito-mount .bg-pf-field {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(226, 179, 98, 0.25);
  border-radius: 7px;
  padding: 6px 10px;
}

#backgammon-saito-mount .bg-pf-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #d6b88c;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

#backgammon-saito-mount .bg-pf-field code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #f8fafc;
  word-break: break-all;
  -webkit-user-select: text;
  user-select: text;
}

#backgammon-saito-mount .bg-pf-formula-box {
  background: rgba(226, 179, 98, 0.08);
  border: 1px solid rgba(226, 179, 98, 0.35);
  border-radius: 7px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#backgammon-saito-mount .bg-pf-formula-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #ffe29a;
}

#backgammon-saito-mount .bg-pf-formula-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e2e8f0;
  -webkit-user-select: text;
  user-select: text;
}

#backgammon-saito-mount .bg-pf-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#backgammon-saito-mount .bg-pf-history-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffe29a;
}

#backgammon-saito-mount .bg-pf-verify-all-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid rgba(74, 222, 128, 0.65);
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  color: #dcfce7;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

#backgammon-saito-mount .bg-pf-verify-all-btn:hover {
  background: linear-gradient(180deg, #15803d 0%, #166534 100%);
}

#backgammon-saito-mount .bg-pf-verify-banner {
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(22, 101, 52, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.6);
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 600;
}

#backgammon-saito-mount .bg-pf-table-wrap {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid rgba(226, 179, 98, 0.25);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.3);
}

#backgammon-saito-mount .bg-pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

#backgammon-saito-mount .bg-pf-table th {
  position: sticky;
  top: 0;
  background: #2b1509;
  color: #ffe29a;
  text-align: left;
  padding: 6px 8px;
  font-weight: 700;
  border-bottom: 1px solid rgba(226, 179, 98, 0.3);
}

#backgammon-saito-mount .bg-pf-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(226, 179, 98, 0.14);
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#backgammon-saito-mount .bg-pf-empty {
  text-align: center;
  padding: 14px !important;
  color: #cbb8a4 !important;
  font-family: system-ui, sans-serif !important;
}

#backgammon-saito-mount .bg-pf-dice-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(226, 179, 98, 0.2);
  border: 1px solid rgba(226, 179, 98, 0.45);
  color: #ffe29a;
  font-weight: 700;
}

#backgammon-saito-mount .bg-pf-proof-valid {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(22, 101, 52, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #86efac;
  font-weight: 600;
  font-size: 10px;
}

#backgammon-saito-mount .bg-pf-proof-invalid {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(153, 27, 27, 0.4);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fca5a5;
  font-weight: 600;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   7. Compact Rules Overlay & In-Game Saito Overlays
   -------------------------------------------------------------------------- */
.saito-overlay:has(.backgammon-rules-overlay) {
  right: auto !important;
  bottom: auto !important;
  width: min(620px, 94vw) !important;
}

.saito-overlay > .saito-overlay-panel.backgammon-rules-overlay,
.backgammon-rules-overlay,
.backgammon-rules-overlay.saito-overlay-size {
  width: min(620px, 92vw) !important;
  max-width: 620px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  padding: 2rem 2.2rem !important;
  box-sizing: border-box !important;
  color: #f8f2e9 !important;
  background: linear-gradient(180deg, rgba(36, 18, 8, 0.98) 0%, rgba(20, 9, 4, 0.99) !important);
  background-color: #1c0d06 !important;
  border: 1px solid rgba(226, 179, 98, 0.55) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.9) !important;
  line-height: 1.5 !important;
}

/* Inline Learn section on the Lobby splash page must never be cut short with an internal scrollbar */
.scrollable-page .backgammon-rules-overlay,
.scrollable-page .backgammon-rules-overlay.saito-overlay-size,
.saito-splash-learn .backgammon-rules-overlay {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-y: visible !important;
}

@media (max-width: 768px) {
  .saito-overlay > .saito-overlay-panel.backgammon-rules-overlay,
  .backgammon-rules-overlay,
  .backgammon-rules-overlay.saito-overlay-size {
    padding: 1.6rem 1.5rem !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-inline: 0 !important;
    box-sizing: border-box !important;
  }
}

.backgammon-rules-overlay .h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffe29a;
  margin-bottom: 8px;
  padding-right: 4rem;
}

.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox {
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: rgba(239, 68, 68, 0.25) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.75) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 3350 !important;
}

.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox::before,
.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox::after,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox::before,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox::after,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox::before,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox::after,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox::before,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 14px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  transform-origin: center !important;
  display: block !important;
}

.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox::before,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox::before,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox::before,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox::before {
  transform: translate(-50%, -50%) rotate(45deg) !important;
}

.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox::after,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox::after,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox::after,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox::after {
  transform: translate(-50%, -50%) rotate(-45deg) !important;
}

.saito-overlay:has(.backgammon-rules-overlay) .saito-overlay-closebox-btn,
.saito-overlay:has(.backgammon-rules-overlay) + .saito-overlay-closebox .saito-overlay-closebox-btn,
.saito-overlay:has(.arcade-wizard) .saito-overlay-closebox-btn,
.saito-overlay:has(.arcade-wizard) + .saito-overlay-closebox .saito-overlay-closebox-btn {
  display: none !important;
}

.backgammon-rules-overlay .h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffe29a;
  margin: 12px 0 6px;
}

.backgammon-rules-overlay p {
  font-size: 13px;
  margin-bottom: 8px;
}

.backgammon-rules-overlay ul {
  padding-left: 18px;
  margin: 0;
}

.backgammon-rules-overlay li {
  font-size: 12.5px;
  margin-bottom: 6px;
  list-style: disc;
}

html.game.backgammon body.backgammon-in-game .message_box {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game .saito-modal {
  max-width: 420px !important;
  width: min(420px, 90vw) !important;
  padding: 18px 20px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #281409 0%, #140904 100%) !important;
  border: 1px solid rgba(226, 179, 98, 0.6) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
}

html.game.backgammon body.backgammon-in-game:not(.bg-chat-opened) .chat-container {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game.bg-chat-opened .chat-container {
  width: min(310px, 88vw) !important;
  min-width: min(270px, 84vw) !important;
  max-height: min(340px, 75vh) !important;
  border-radius: 12px 12px 0 0 !important;
  border: 1px solid rgba(226, 179, 98, 0.65) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85) !important;
  z-index: 2600 !important;
  pointer-events: auto !important;
}

html.game.backgammon body.backgammon-in-game.bg-chat-opened .chat-container.active {
  z-index: 2610 !important;
}

html.game.backgammon body.backgammon-in-game .chat-container,
html.game.backgammon body.backgammon-in-game .chat-container * {
  pointer-events: auto !important;
}

html.game.backgammon body.backgammon-in-game .chat-container .saito-input,
html.game.backgammon body.backgammon-in-game .chat-container .saito-input *,
html.game.backgammon body.backgammon-in-game .chat-container .text-input,
html.game.backgammon body.backgammon-in-game .chat-container .chat-body,
html.game.backgammon body.backgammon-in-game .chat-container .chat-body *,
html.game.backgammon body.backgammon-in-game .chat-container input,
html.game.backgammon body.backgammon-in-game .chat-container textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

html.game.backgammon body.backgammon-in-game .chat-container .text-input,
html.game.backgammon body.backgammon-in-game .chat-container input,
html.game.backgammon body.backgammon-in-game .chat-container textarea {
  cursor: text !important;
}

.stake-info-overlay {
  width: min(440px, 92vw);
  max-width: 440px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(36, 18, 8, 0.98) 0%, rgba(18, 8, 3, 0.99) 100%);
  border: 1px solid rgba(226, 179, 98, 0.65);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.9);
  color: #f8f2e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stake-info-overlay .bg-stake-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(226, 179, 98, 0.25);
}

.stake-info-overlay .bg-stake-modal-icon {
  font-size: 22px;
}

.stake-info-overlay .bg-stake-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffe29a;
}

.stake-info-overlay .bg-stake-modal-sub {
  font-size: 11px;
  color: #d6c5b3;
}

.stake-info-overlay .bg-stake-breakdown {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
}

.stake-info-overlay .bg-stake-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stake-info-overlay .bg-stake-row-muted {
  color: #cbb8a4;
  font-size: 11.5px;
}

.stake-info-overlay .bg-stake-row-rake {
  color: #fcd34d;
  font-size: 12px;
}

.stake-info-overlay .bg-stake-row-rake-total {
  color: #fde68a;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(226, 179, 98, 0.14);
}

.stake-info-overlay .bg-stake-row-winner {
  color: #86efac;
  font-size: 13.5px;
}

.stake-info-overlay .bg-stake-row-profit {
  color: #bbf7d0;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(22, 101, 52, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.45);
}

.stake-info-overlay .bg-stake-divider {
  height: 1px;
  background: rgba(226, 179, 98, 0.22);
  margin: 3px 0;
}

/* --------------------------------------------------------------------------
   8. Splash Page Leaderboard & Recent Activity + Crypto Stake Rake Notice
   -------------------------------------------------------------------------- */
.backgammon-splash-empty-panel {
  padding: 20px 22px;
  border-radius: 12px;
  background: rgba(14, 7, 3, 0.72);
  border: 1px solid rgba(226, 179, 98, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: #f8f2e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.backgammon-splash-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffe29a;
  margin-bottom: 6px;
}

.backgammon-splash-empty-sub {
  font-size: 13px;
  line-height: 1.5;
  color: #d6c5b3;
}

.backgammon-splash-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backgammon-splash-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(14, 7, 3, 0.75);
  border: 1px solid rgba(226, 179, 98, 0.35);
  color: #f8f2e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.backgammon-splash-activity-players {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

.backgammon-splash-activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.backgammon-splash-activity-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(226, 179, 98, 0.22);
  border: 1px solid rgba(226, 179, 98, 0.55);
  color: #ffe29a;
  font-size: 11.5px;
  font-weight: 700;
}

/* Readable labels and 2.5% House Rake notice inside Play for Crypto modal & wizard */
#stake-crypto-request-container .game-stake-label,
#stake-crypto-request-container label,
#approve-crypto-request-container label,
#approve-crypto-request-container .stake-amount {
  color: #e6eef4 !important;
}

#stake-crypto-request-container .stake-mode-toggle {
  color: #cfe3ef !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.backgammon-crypto-rake-note {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(230, 238, 244, 0.85);
  text-align: center;
  letter-spacing: 0.2px;
}

.backgammon-wizard-rake-note {
  margin-top: 6px;
  padding: 5px 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  text-align: right;
  letter-spacing: 0.2px;
}

/* --------------------------------------------------------------------------
   9. Wallet Drawer Back Bar, Rules Footer & Rematch / Modal Polish
   -------------------------------------------------------------------------- */
html.game.backgammon body.backgammon-in-game #saito-header .saito-header-hamburger-contents:not(.show-menu),
html.game.backgammon body.backgammon-in-game #saito-header.game .saito-header-hamburger-contents:not(.show-menu) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.game.backgammon body.backgammon-in-game #saito-header .saito-header-hamburger-contents.show-menu,
html.game.backgammon body.backgammon-in-game #saito-header.game .saito-header-hamburger-contents.show-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  position: fixed !important;
  top: 50px !important;
  right: 0 !important;
  left: auto !important;
  width: min(400px, 100vw) !important;
  max-width: 100vw !important;
  height: calc(100dvh - 50px) !important;
  max-height: calc(100dvh - 50px) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: rgba(26, 12, 5, 0.98) !important;
  border-left: 1px solid rgba(226, 179, 98, 0.5) !important;
  box-shadow: -10px 14px 40px rgba(0, 0, 0, 0.9) !important;
  z-index: 3150 !important;
}

@media screen and (max-width: 600px) {
  html.game.backgammon body.backgammon-in-game #saito-header .saito-header-hamburger-contents.show-menu,
  html.game.backgammon body.backgammon-in-game #saito-header.game .saito-header-hamburger-contents.show-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    border-left: none !important;
  }
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-profile,
html.game.backgammon #saito-header .saito-header-hamburger-contents .wallet-btn-container,
html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section,
html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-menu {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .wallet-btn-container {
  padding: 0 12px !important;
  gap: 8px !important;
  margin: 8px 0 !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section {
  padding: 6px 14px 20px !important;
  gap: 14px !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-menu ul {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 10px !important;
  row-gap: 14px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  justify-items: center !important;
  align-items: start !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-menu li,
html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-header-appspace-option {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 8px 4px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: center !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-header-appspace-option > i,
html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-menu li > i {
  font-size: 24px !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 auto 6px auto !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-module-menu-icon-wrap {
  width: 28px !important;
  height: 28px !important;
  margin: 0 auto 6px auto !important;
}

html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-menu-item-label,
html.game.backgammon #saito-header .saito-header-hamburger-contents .saito-header-menu-section .saito-menu li > span:not(.saito-module-menu-icon-wrap) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 2px 2px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  box-sizing: border-box !important;
}

.bg-wallet-back-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 6px 10px 10px 10px !important;
  margin-bottom: 6px !important;
  border-bottom: 1px solid rgba(226, 179, 98, 0.3) !important;
}

.bg-wallet-back-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  background: rgba(226, 179, 98, 0.16) !important;
  border: 1px solid rgba(226, 179, 98, 0.5) !important;
  color: #ffe29a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.bg-wallet-close-btn {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: rgba(239, 68, 68, 0.22) !important;
  border: 1px solid rgba(239, 68, 68, 0.6) !important;
  color: #fff !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.backgammon-rules-footer {
  border-top: 1px solid rgba(226, 179, 98, 0.28);
  padding-top: 12px;
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

html.game.backgammon body.backgammon-in-game #game-hud2.bg-hud-hidden,
html.game.backgammon body.backgammon-in-game .game-hud2.bg-hud-hidden,
html.game.backgammon body.backgammon-in-game .hud.bg-hud-hidden {
  display: none !important;
}

html.game.backgammon body.backgammon-in-game .hud-menu .option.bg-rematch-incoming {
  background: linear-gradient(180deg, #166534 0%, #14532d 100%) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.4) !important;
}

html.game.backgammon .saito-modal,
html.game.backgammon .saito-overlay {
  z-index: 3300 !important;
}

html.game.backgammon .saito-overlay-backdrop {
  z-index: 3250 !important;
}

/* Compact Landscape Mobile HUD (when height <= 500px) */
@media screen and (max-height: 500px) {
  html.game.backgammon body.backgammon-in-game .game-menu {
    top: 4px !important;
    left: 6px !important;
  }
  html.game.backgammon body.backgammon-in-game .game-menu > ul {
    height: 28px !important;
    padding: 0 2px !important;
  }
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-option,
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
    height: 26px !important;
    line-height: 26px !important;
    min-width: 58px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }
  html.game.backgammon body.backgammon-in-game .game-menu > ul > li.game-menu-icon {
    min-width: 30px !important;
    width: 30px !important;
    max-width: 30px !important;
    line-height: 26px !important;
  }
  html.game.backgammon body.backgammon-in-game #saito-header .hamburger-container,
  html.game.backgammon body.backgammon-in-game #saito-header.game .hamburger-container {
    top: 4px !important;
    right: 6px !important;
  }
  html.game.backgammon body.backgammon-in-game #saito-header #saito-header-menu-toggle,
  html.game.backgammon body.backgammon-in-game #saito-header.game #saito-header-menu-toggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }
}

/* --------------------------------------------------------------------------
   9. Hero Lobby Hub & Live Game Invites (Mobile + Desktop Splash)
   -------------------------------------------------------------------------- */
.bg-hero-lobby-hub {
  margin: 14px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 680px;
}

.bg-hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#bg-hero-create-btn,
.bg-hero-create-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  border: 1.5px solid #fef08a !important;
  color: #1c0b04 !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.42), 0 2px 8px rgba(0, 0, 0, 0.65) !important;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease !important;
}

#bg-hero-create-btn:hover,
.bg-hero-create-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.56), 0 3px 10px rgba(0, 0, 0, 0.7) !important;
}

#bg-hero-ai-btn,
.bg-hero-ai-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 11px 18px !important;
  border-radius: 10px !important;
  background: rgba(34, 16, 7, 0.86) !important;
  border: 1px solid rgba(226, 179, 98, 0.48) !important;
  color: rgba(248, 250, 252, 0.92) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

#bg-hero-ai-btn:hover,
.bg-hero-ai-btn:hover {
  background: rgba(226, 179, 98, 0.18) !important;
  border-color: rgba(226, 179, 98, 0.8) !important;
  color: #ffe29a !important;
  transform: translateY(-1px);
}

.bg-wizard-ai-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.bg-wizard-ai-text {
  font-size: 12.5px;
  color: rgba(203, 213, 225, 0.85);
  font-weight: 400;
}

.bg-wizard-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(226, 179, 98, 0.42);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.bg-wizard-ai-btn:hover {
  background: rgba(226, 179, 98, 0.16);
  border-color: rgba(226, 179, 98, 0.78);
  color: #ffe29a;
}

.bg-hero-rules-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px !important;
  border-radius: 10px !important;
  background: rgba(34, 16, 7, 0.88) !important;
  border: 1px solid rgba(226, 179, 98, 0.55) !important;
  color: #ffe29a !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
}

.bg-hero-rules-btn:hover {
  background: rgba(226, 179, 98, 0.22) !important;
}

.bg-hero-invites-box {
  background: rgba(22, 10, 4, 0.92);
  border: 1px solid rgba(226, 179, 98, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.bg-hero-invites-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(226, 179, 98, 0.22);
}

.bg-hero-invites-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffe29a;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.bg-hero-invites-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(226, 179, 98, 0.16);
  border: 1px solid rgba(226, 179, 98, 0.4);
  color: #ffe29a;
}

.bg-hero-invites-badge.has-live {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.65);
  color: #86efac;
}

.bg-hero-invites-empty {
  font-size: 12.5px;
  color: rgba(249, 243, 235, 0.85);
  line-height: 1.45;
  padding: 4px 0;
}

.bg-splash-activity-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bg-splash-activity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bg-invite-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(226, 179, 98, 0.55);
  background: rgba(226, 179, 98, 0.16);
  color: #ffe29a;
  transition: transform 0.12s ease, background 0.12s ease;
}

.bg-invite-action-btn.is-join {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border-color: #86efac;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.4);
}

.bg-invite-action-btn.is-resume {
  background: linear-gradient(135deg, #f5d382 0%, #c89432 100%);
  border-color: #ffe8ad;
  color: #1c0b04;
  font-weight: 700;
}

.bg-invite-action-btn.is-cancel {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}

.bg-invite-action-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .bg-hero-cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .bg-hero-create-btn,
  .bg-hero-ai-btn,
  .bg-hero-rules-btn {
    width: 100%;
  }
  .backgammon-splash-activity-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bg-splash-activity-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Confirmation / Alert Modal (#saito-alert-box) Responsive Button Row */
html.game.backgammon #saito-alert-box {
  width: min(500px, 92vw) !important;
  max-width: 92vw !important;
  box-sizing: border-box !important;
  padding: 20px !important;
}

html.game.backgammon #saito-alert-box .saito-button-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 14px !important;
}

html.game.backgammon #saito-alert-box .saito-button-row > button,
html.game.backgammon #saito-alert-box .saito-button-row > .saito-button-primary,
html.game.backgammon #saito-alert-box .saito-button-row > .saito-button-secondary {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: 190px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Responsive Lobby Leaderboard & Splash Info */
.saito-splash-section .saito-splash-info,
.saito-splash-info {
  width: min(56rem, 92vw) !important;
  max-width: min(62.5rem, 92vw) !important;
  box-sizing: border-box !important;
}

.league-leaderboard .saito-table-header,
.league-leaderboard .saito-table-row {
  grid-template-columns: 4rem minmax(12rem, 1fr) 5.5rem 5.5rem 5rem !important;
  align-items: center !important;
}

.league-leaderboard .saito-table-row > div,
.league-leaderboard .saito-table-header > div {
  min-width: 0 !important;
}

.league-leaderboard .saito-table-row .saito-address {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  display: block !important;
  text-align: left !important;
}

@media screen and (max-width: 600px) {
  .saito-splash-section .saito-splash-info,
  .saito-splash-info {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 1.25rem 0.9rem !important;
    box-sizing: border-box !important;
  }

  .league-leaderboard .saito-table-header,
  .league-leaderboard .saito-table-body {
    font-size: 1.05rem !important;
  }

  .league-leaderboard .saito-table-header,
  .league-leaderboard .saito-table-row {
    grid-template-columns: 2.2rem minmax(8.5rem, 1fr) 3.4rem 3.8rem 3.2rem !important;
    grid-gap: 0.35rem !important;
    padding: 0.5rem 0.4rem !important;
    align-items: center !important;
  }

  .league-leaderboard .saito-table-row .saito-address {
    font-size: 1.08rem !important;
  }
}

/* 1P AI Practice Setup Modal (#bg-ai-setup-modal) */
.bg-ai-setup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3400;
  background: rgba(14, 6, 2, 0.84);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.bg-ai-setup-card {
  position: relative;
  width: min(640px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(36, 17, 7, 0.98) 0%, rgba(18, 8, 3, 0.99) 100%);
  border: 1px solid rgba(226, 179, 98, 0.65);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.9);
  color: #f9f3eb;
  text-align: center;
  box-sizing: border-box;
}

.bg-ai-setup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 179, 98, 0.45);
  color: #ffe29a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bg-ai-setup-kicker {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(226, 179, 98, 0.16);
  border: 1px solid rgba(226, 179, 98, 0.5);
  color: #ffe29a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.bg-ai-setup-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.bg-ai-setup-sub {
  margin: 6px 0 16px 0;
  font-size: 13px;
  color: rgba(249, 243, 235, 0.84);
}

.bg-ai-setup-section {
  text-align: left;
  background: rgba(22, 10, 4, 0.76);
  border: 1px solid rgba(226, 179, 98, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.bg-ai-setup-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffe29a;
  margin-bottom: 9px;
}

.bg-ai-setup-diff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.bg-ai-diff-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(42, 20, 9, 0.78);
  border: 1px solid rgba(226, 179, 98, 0.3);
  color: #f9f3eb;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.bg-ai-diff-card:hover {
  border-color: rgba(251, 191, 36, 0.75);
  transform: translateY(-1px);
}

.bg-ai-diff-card.active {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.26) 0%, rgba(180, 83, 9, 0.24) 100%);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.28);
}

.bg-ai-diff-tier {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fbbf24;
}

.bg-ai-diff-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.bg-ai-diff-desc {
  font-size: 11.5px;
  color: rgba(249, 243, 235, 0.82);
  line-height: 1.3;
}

.bg-ai-controls-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bg-ai-ctrl-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(38, 18, 8, 0.68);
  border: 1px solid rgba(226, 179, 98, 0.22);
}

.bg-ai-ctrl-key {
  font-size: 12px;
  font-weight: 700;
  color: #ffe29a;
}

.bg-ai-ctrl-txt {
  font-size: 11.5px;
  color: rgba(249, 243, 235, 0.88);
  line-height: 1.32;
}

.bg-ai-setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.bg-ai-setup-rules-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 10px;
  background: rgba(38, 18, 8, 0.92);
  border: 1px solid rgba(226, 179, 98, 0.5);
  color: #ffe29a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bg-ai-setup-start-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border: 1.5px solid #fef08a;
  color: #1c0b04;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.42);
}

@media (max-width: 600px) {
  .bg-ai-setup-diff-grid,
  .bg-ai-controls-mini-grid {
    grid-template-columns: 1fr;
  }
  .bg-ai-setup-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

/* [GAMES-01] & [GAMES-02] Rules overlay scroll & Mobile Landscape AI Setup Card */
.game-rules-overlay,
.backgammon-rules-overlay {
  max-height: 85dvh !important;
  overflow-y: auto !important;
}

@media (max-width: 932px) and (max-height: 500px) {
  .bg-ai-setup-card {
    max-height: 88dvh !important;
    overflow-y: auto !important;
    padding: 14px 18px !important;
  }
  .bg-ai-setup-actions {
    position: sticky;
    bottom: 0;
    background: rgba(18, 9, 4, 0.96);
    padding-top: 8px;
    z-index: 2;
  }
}





html.game.backgammon body.backgammon-in-game {
  background-color: #000 !important;
}

/*ios fullscreen*/
.xxx-game-iframe-iphone-se {
  height: 226px !important;
}

.xxx-ios-fullscreen-message {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  display: none;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-touch-action: none;
  touch-action: none;
}

.xxx-ios-fullscreen-scroll {
  width: 100vw;
  height: 120vh;
  position: absolute;
  z-index: 10001;
  top: 0;
  left: 0;
  display: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-touch-action: none;
  touch-action: none;
}

.xxx-ios-fullscreen-swipe {
  width: 30%;
  height: 30%;
  background-image: url('/backgammon/sprites/swipe.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%) !important;
  -webkit-transform: translate(-50%, -50%) !important;
  transform: translate(-50%, -50%) !important;
  animation: xxx-animation-ios-swipe 1.5s ease infinite;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-touch-action: none;
  touch-action: none;
}

@keyframes xxx-animation-ios-swipe {
  0%,
  100% {
    top: 40%;
  }
  50% {
    top: 60%;
  }
}/* Backgammon renders on HTML5 Canvas; do not reset global Saito DOM tags */
.orientation-msg-container{
    width: 100%;
    height: 100%;
    display: none;
    position: fixed;
    background-color: #000;
}

.orientation-msg-text{
    font-size: 40px;
    font-family: "Arial";
    color: #fff;
    text-align: center;
    width: 80%;
    
    position: fixed;
    top: 50%;
    -webkit-transform: translate(15%,-50%);
    -moz-transform: translate(15%,-50%);
    -ms-transform: translate(15%,-50%);
    transform: translate(15%,-50%);
    
        
}

@media (max-width: 767px) {
    .orientation-msg-text{    
        font-size: 30px;  
    }
}


@media (max-width: 500px) {
    .orientation-msg-text{    
        font-size: 30px;  
    }
}