/* Player lobby and account surfaces. Uploaded logos, slides, game covers and
   custom shortcut images continue to come from the site's own configuration. */
html.bh-refined-theme {
  --portal-text: #f7f4fc;
  --portal-secondary: #c5bdcf;
  --portal-line: #38333e;
  --portal-panel: #171519;
  --portal-raised: #211d26;
  --portal-selected: #463356;
  --portal-violet: #c39cff;
  --portal-action: linear-gradient(100deg, #6448f0, #9434dc);
}

/* Keep the existing back action in the masthead, clear of the game covers. */
.bh-refined-theme body.bh-surface .site-header #platformFloatingBack {
  position: static;
  flex: 0 0 29px;
  width: 29px;
  height: 33px;
  min-height: 0;
  min-width: 0;
  padding: 0;
  margin: 0 4px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #d6cddd;
  font-size: 16px;
}
.bh-refined-theme body:has(#page-home.active) .site-header #platformFloatingBack { display: none; }

html.bh-refined-theme,
.bh-refined-theme body.bh-surface[data-variant],
.bh-refined-theme body.bh-surface .mobile-shell {
  background: #000;
  color: var(--portal-text);
}

.bh-refined-theme body.bh-surface .site-header {
  background: rgb(5 5 6 / 97%);
  border-color: #2f2a35;
  box-shadow: 0 1px 0 rgb(255 255 255 / 3%);
}

.bh-refined-theme .site-header .bh-profile :is(.gold-button, .header-login) {
  min-height: 38px;
  padding: 7px 19px;
  border-radius: 999px;
}

.bh-refined-theme body.bh-surface .site-header .bh-profile .header-login {
  background: #201b28;
  border-color: #54475f;
  color: #f4effa;
}

.bh-refined-theme body.bh-surface .site-header .bh-profile .gold-button {
  background: var(--portal-action);
  border-color: #a47af2;
  color: #fff;
}

.bh-refined-theme body.bh-surface #page-home :is(.panel, .welcome-bar, .announcement) {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.bh-refined-theme body.bh-surface #page-home :is(.hero, .carousel-slide) {
  background-color: var(--portal-panel);
  border-color: #322d37;
  border-radius: 14px;
}

.bh-refined-theme body.bh-surface #page-home .hero {
  overflow: hidden;
}

.bh-refined-theme body.bh-surface :is(.portal-heading h1, .page-title h1, .section-heading h2, .bh-account-section-heading h2) {
  color: var(--portal-text);
  font-weight: 700;
  letter-spacing: -.02em;
}

.bh-refined-theme body.bh-surface #page-home .section-heading .text-button,
.bh-refined-theme body.bh-surface .portal-heading .text-link {
  color: var(--portal-secondary);
}

.bh-refined-theme body.bh-surface #page-home .wallet-panel {
  background: linear-gradient(110deg, #231a32, #111014 68%);
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  box-shadow: none;
}

.bh-refined-theme body.bh-surface #page-home #balance-value { color: #fff; }
.bh-refined-theme body.bh-surface #page-home .balance-caption { color: var(--portal-secondary); }
.bh-refined-theme body.bh-surface #page-home .announcement strong,
.bh-refined-theme body.bh-surface #page-home .welcome-bar strong,
.bh-refined-theme body.bh-surface .bh-broadcast-label {
  color: #dfc4ff;
}
.bh-refined-theme body.bh-surface #page-home :is(.announcement, .welcome-bar) p > span,
.bh-refined-theme body.bh-surface .bh-broadcast-text {
  color: #d8d0e1;
}
.bh-refined-theme body.bh-surface .bh-broadcast {
  border-color: #493a53;
  background: linear-gradient(105deg, #281d33, #171419 66%);
}
.bh-refined-theme body.bh-surface .bh-broadcast-label { border-color: #514258; }
.bh-refined-theme body.bh-surface .bh-broadcast-controls button { color: #dec0fc; }
.bh-refined-theme body.bh-surface #page-home :is(.announcement [data-icon], #toggle-balance [data-icon]),
.bh-refined-theme body.bh-surface #page-home #home-shortcuts
    :is([data-action="service"], [data-action="my-vip"]) .bh-shortcut-icon > [data-icon],
.bh-refined-theme body.bh-surface #page-home .quick-actions
    :is([data-nav="activity"], [data-action="service"]) [data-icon] {
  filter: brightness(0) saturate(100%) invert(82%) sepia(32%) saturate(1818%) hue-rotate(205deg);
}

.bh-refined-theme body.bh-surface #page-home :is(.wallet-actions button, .quick-actions > button, .quick-actions > a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  background: var(--portal-raised);
  border: 1px solid #48404f;
  color: #f9f6fd;
  box-shadow: none;
}

.bh-refined-theme body.bh-surface #page-home :is(.quick-actions, .wallet-actions) [data-action="recharge"] {
  --portal-icon: url("./xhrr-art/portal-deposit.webp");
}
.bh-refined-theme body.bh-surface #page-home :is(.quick-actions, .wallet-actions) [data-action="withdraw"] {
  --portal-icon: url("./xhrr-art/portal-withdraw.webp");
}
.bh-refined-theme body.bh-surface #page-home #home-user-card [data-action="recharge"],
.bh-refined-theme body.bh-surface #page-home .account-card .account-actions [data-action="recharge"] {
  background: var(--portal-action);
  color: #fff;
  border: 1px solid #a477eb;
  box-shadow: inset 0 1px 0 #ffffff26;
}
.bh-refined-theme body.bh-surface #page-home #home-user-card [data-action="withdraw"],
.bh-refined-theme body.bh-surface #page-home .account-card .account-actions [data-action="withdraw"] {
  background: #26212e;
  color: #f3eafa;
  border: 1px solid #584b64;
  box-shadow: none;
}
.bh-refined-theme body.bh-surface #page-home :is(.quick-actions, .wallet-actions)
    :is([data-action="recharge"], [data-action="withdraw"]) [data-icon] {
  display: inline-block;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  background: var(--portal-icon) center / contain no-repeat;
  filter: none;
}
.bh-refined-theme body.bh-surface #page-home :is(.quick-actions, .wallet-actions)
    :is([data-action="recharge"], [data-action="withdraw"]) [data-icon] > img {
  visibility: hidden;
}

.bh-refined-theme body.bh-surface #page-home #home-shortcuts > button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.bh-refined-theme body.bh-surface #page-home #home-shortcuts .bh-shortcut-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: #211a28;
  filter: none;
}
.bh-refined-theme body.bh-surface #page-home #home-shortcuts > [data-nav="offers"] {
  --portal-icon: url("./xhrr-art/portal-task.webp");
}
.bh-refined-theme body.bh-surface #page-home #home-shortcuts > [data-action="agent-center"] {
  --portal-icon: url("./xhrr-art/portal-agent.webp");
}
/* The icon wrapper is only present on default icons. Configured artwork wins. */
.bh-refined-theme body.bh-surface #page-home #home-shortcuts
    :is([data-nav="offers"], [data-action="agent-center"]) .bh-shortcut-icon > [data-icon] {
  width: 40px;
  height: 40px;
  background: var(--portal-icon) center / contain no-repeat;
}
.bh-refined-theme body.bh-surface #page-home #home-shortcuts
    :is([data-nav="offers"], [data-action="agent-center"]) .bh-shortcut-icon > [data-icon] img {
  visibility: hidden;
}
.bh-refined-theme body.bh-surface #page-home #home-shortcuts > button > span:last-child {
  color: #ece7f2;
}

/* The reference category rail scrolls horizontally rather than scaling the
   thumbnail grid down as more categories are returned. */
.bh-refined-theme body.bh-surface[data-variant] #page-home #categories {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  background: #161417;
  border: 1px solid #3c3740;
  border-radius: 24px;
  box-shadow: none;
}
.bh-refined-theme body.bh-surface #page-home #categories .category {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 38px;
  padding: 4px 13px;
  background: transparent;
  border: 0;
  border-radius: 18px;
}
.bh-refined-theme body.bh-surface #page-home #categories .category-all:not([aria-pressed="false"]) {
  background: var(--portal-selected);
}
.bh-refined-theme body.bh-surface #page-home #categories .category-art {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  filter: none;
}
.bh-refined-theme body.bh-surface #page-home #categories .category-art::after {
  content: none;
}
.bh-refined-theme body.bh-surface #page-home #categories .category-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bh-refined-theme body.bh-surface #page-home #categories .category:not(:has(.category-label)) .category-art {
  width: 82px;
  height: 40px;
}
.bh-refined-theme body.bh-surface #page-home #categories .category-label {
  position: static;
  color: #f4eff7;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

/* Game names remain readable across both bright and dark provider artwork. */
.bh-refined-theme body.bh-surface :is(#game-grid, #bh-game-list, #bh-account-favorites) .game-card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #19151c;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 0 0 1px #ffffff13;
}
.bh-refined-theme body.bh-surface :is(#game-grid, #bh-game-list, #bh-account-favorites) .game-art {
  aspect-ratio: 1;
  border-radius: inherit;
}
.bh-refined-theme body.bh-surface :is(#game-grid, #bh-game-list, #bh-account-favorites) .game-meta {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  padding: 22px 6px 8px;
  background: linear-gradient(transparent, rgb(16 10 24 / 82%) 75%);
  color: #fff;
  pointer-events: none;
}
.bh-refined-theme body.bh-surface :is(#game-grid, #bh-game-list, #bh-account-favorites) .game-meta h3 {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px #000;
}
.bh-refined-theme body.bh-surface .bh-game-wrap > .favorite-button {
  z-index: 3;
  background: rgb(15 12 18 / 83%);
  border: 1px solid #ffffff40;
  border-radius: 50%;
}
.bh-refined-theme body.bh-surface .bh-game-wrap > .favorite-button.is-saved {
  background: #59436e;
  border-color: #d2adff;
}

.bh-refined-theme body.bh-surface :is(#page-game, #page-my) :is(.surface, .profile-banner, .search-field) {
  border: 1px solid var(--portal-line);
  background: var(--portal-panel);
  border-radius: 16px;
  box-shadow: none;
}
.bh-refined-theme body.bh-surface #page-my .profile-banner {
  background: radial-gradient(ellipse at 0 0, #382a49, transparent 66%), #17131b;
}
.bh-refined-theme body.bh-surface #page-my .profile-avatar {
  background: #443050;
  border: 1px solid #705482;
}
.bh-refined-theme body.bh-surface :is(#page-game, #page-my) :is(.account-menu, .lobby-sidebar) button {
  border-radius: 10px;
  color: #e3dce9;
}
.bh-refined-theme body.bh-surface :is(#page-game, #page-my)
    :is(.account-menu button.is-active, .lobby-sidebar button.is-active,
        .bh-provider-pill[aria-pressed="true"], .pill-tabs .is-active) {
  border-color: #665474;
  background: var(--portal-selected);
  color: #fff;
  box-shadow: none;
}
.bh-refined-theme body.bh-surface #page-game .search-field input {
  color: #fff;
  background: transparent;
}

/* Desktop keeps its full-width catalogue and the site's existing sidebar. */
.bh-refined-theme body.bh-surface[data-variant="desktop"] .site-header .main-nav a {
  padding: 8px 14px;
  border-radius: 18px;
  color: #d9d1df;
}
.bh-refined-theme body.bh-surface[data-variant="desktop"] .site-header .main-nav a.is-active {
  background: #302638;
  color: #f8f1ff;
}
.bh-refined-theme body.bh-surface[data-variant="desktop"] .site-header .main-nav a.is-active::after { content: none; }
.bh-refined-theme body.bh-surface[data-variant="desktop"] #page-home > :is(.games-section, .activities-section) {
  padding: 16px 0 12px;
}

/* The mobile footer floats above the OS safe area as in the XHRR H5. */
.bh-refined-theme body.bh-surface[data-variant="mobile"] .mobile-shell {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] .bottom-nav {
  width: calc(100% - 24px);
  max-width: 456px;
  bottom: max(9px, env(safe-area-inset-bottom, 0px));
  padding: 4px;
  gap: 2px;
  border: 1px solid #49434d;
  border-radius: 32px;
  background: rgb(23 21 26 / 96%);
  box-shadow: 0 6px 22px #0007;
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] .bottom-nav a {
  min-height: 48px;
  color: #d1cbd7;
  border-radius: 26px;
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] .bottom-nav a.is-active {
  background: #443451;
  color: #fff;
  box-shadow: none;
  text-shadow: none;
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] .bottom-nav .custom-icon {
  opacity: 1;
  filter: grayscale(1) brightness(1.2);
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] .bottom-nav .is-active .custom-icon {
  filter: brightness(0) saturate(100%) invert(79%) sepia(49%) saturate(1280%) hue-rotate(210deg);
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] #page-home #categories {
  margin-block: 12px 20px;
  scrollbar-width: none;
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] #page-home #categories::-webkit-scrollbar { display: none; }
.bh-refined-theme body.bh-surface[data-variant="mobile"] #page-home #categories .category { padding-inline: 9px; }
.bh-refined-theme body.bh-surface[data-variant="mobile"] #page-home #home-shortcuts {
  margin-block: 9px 12px;
}
.bh-refined-theme body.bh-surface[data-variant="mobile"] #page-home #home-shortcuts > button {
  min-height: 64px;
  gap: 4px;
  padding: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .bh-refined-theme body.bh-surface #page-home #categories .category:hover,
  .bh-refined-theme body.bh-surface :is(#page-game, #page-my) :is(.lobby-sidebar, .account-menu) button:hover {
    background-color: #342c3a;
    color: #fff;
  }
  .bh-refined-theme body.bh-surface .bh-game-wrap .game-card:hover {
    box-shadow: 0 0 0 2px #9571af;
  }
}

/* One glass treatment for category, vendor and library controls on both clients. */
.bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories, #page-game #bh-game-platforms, #page-game .library-toolbar .pill-tabs) {
  --nav-glass: linear-gradient(165deg, #e6d9ff24 0%, #dacaef0d 40%, #aaa0ba12 100%), #201c29c9;
  --nav-selected: linear-gradient(150deg, #ac87d9 0%, #765498 32%, #624278 66%, #7a518b 100%);
  --nav-edge: #c0a9cd3d;
  --nav-light: inset 0 1px 0 #ffefff21, inset 0 -1px 0 #07040b4d;
}
.bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories) {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
  border: 1px solid #bba7cb4d;
  border-radius: 999px;
  background: linear-gradient(108deg, #6958753b, #31293717 45%, #80668721), #111014df;
  box-shadow: inset 0 1px 0 #f2d5ff24, inset 0 -1px 0 #9c80ae12;
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}
.bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories) > button[data-category],
.bh-refined-theme body.bh-surface #main #page-game #bh-game-platforms [data-game-platform],
.bh-refined-theme body.bh-surface #main #page-game .library-toolbar .pill-tabs [data-view] {
  box-sizing: border-box;
  max-width: calc(100% - 4px);
  min-width: 0;
  border: 1px solid var(--nav-edge);
  border-radius: 999px;
  background: var(--nav-glass);
  box-shadow: var(--nav-light);
  color: #eee6f3;
  font-weight: 550;
  text-shadow: 0 1px 2px #0005;
}
.bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories) > button :is(.category-label, .bh-category-name) {
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bh-refined-theme body.bh-surface #main #page-game #bh-game-platforms [data-game-platform] {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bh-refined-theme body.bh-surface #main #page-home #categories > button.category-all:not([aria-pressed="false"]),
.bh-refined-theme body.bh-surface #main #page-home #categories > button[data-category][aria-pressed="true"],
.bh-refined-theme body.bh-surface #main #page-game #bh-lobby-categories > button.is-active[aria-pressed="true"],
.bh-refined-theme body.bh-surface #main #page-game #bh-game-platforms button[data-game-platform][aria-pressed="true"],
.bh-refined-theme body.bh-surface #main #page-game .library-toolbar .pill-tabs button[data-view].is-active {
  border-color: #d9b8f6a6;
  background: var(--nav-selected);
  box-shadow: inset 0 1px 0 #ffefff82, inset 0 -1px 0 #341a4880, 0 2px 5px #09050d52;
  color: #fff;
  font-weight: 650;
}
.bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories, #page-game #bh-game-platforms, #page-game .library-toolbar .pill-tabs) > button:focus-visible {
  outline: 2px solid #eed8ff;
  outline-offset: -3px;
}
@media (hover: hover) and (pointer: fine) {
  .bh-refined-theme body.bh-surface #main :is(#page-home #categories, #page-game #bh-lobby-categories, #page-game #bh-game-platforms, #page-game .library-toolbar .pill-tabs) > button:hover {
    border-color: #e6ccff99;
    filter: brightness(1.14);
  }
}
