
html {
  background-color: #14103f;
  min-height: 100%;
}

:root {
  --mobile-overlay-z: 940;
  --mobile-side-nav-z: 980;
  --mobile-betslip-z: 960;
  --mobile-nav-h: 58px;
  --mobile-nav-total: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  --mobile-betslip-radius: 18px;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(8, 6, 28, .62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
  border: 0;
  padding: 0;
  cursor: pointer;
}

body.mobile-side-nav-open .mobile-overlay,
body.mobile-betslip-open .mobile-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.mobile-betslip-open .mobile-overlay {
  background: rgba(8, 6, 28, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.menu-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(99, 69, 186, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  display: none;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  cursor: pointer;
}

.menu-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  fill: none;
}

.sportsbook-topbar-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sportsbook-topbar-titles {
  min-width: 0;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  min-height: var(--mobile-nav-total);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  display: none;
  grid-template-columns: repeat(var(--bottom-nav-cols, 5), 1fr);
  gap: 2px;
  background: rgba(20, 15, 61, .94);
  border-top: 1px solid rgba(152, 104, 255, .28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-nav .nav-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  color: #aea2d6;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px;
  position: relative;
  font-family: inherit;
}

.bottom-nav .nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.bottom-nav .nav-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.bottom-nav .nav-item.nav-item--img svg {
  display: none;
}

.bottom-nav .nav-item .fill-icon {
  fill: currentColor;
  stroke: none;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item[aria-pressed='true'] {
  color: #fff;
}

.bottom-nav .nav-item--betslip.active {
  color: #c8f5d4;
}

.nav-item-badge {
  position: absolute;
  top: 0;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: linear-gradient(135deg, #8d55ff, #22df4f);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-item-badge:empty,
.nav-item-badge[hidden] {
  display: none;
}

.mobile-betslip-header {
  display: none;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(152, 104, 255, .22);
  background: transparent;
}

.mobile-betslip-header__titles {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mobile-betslip-header__titles strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.mobile-betslip-header__titles span {
  font-size: 12px;
  color: #b9a8e8;
  font-weight: 700;
}

.mobile-betslip-grab-wrap {
  display: none !important;
}

.mobile-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 899px) {
  body.has-mobile-chrome {
    overflow-x: hidden;
  }

  body.mobile-betslip-open,
  body.mobile-side-nav-open,
  body.has-mobile-chrome.mobile-betslip-open,
  body.has-mobile-chrome.mobile-side-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .menu-button {
    display: grid;
  }

  body.has-mobile-chrome .bottom-nav {
    display: grid;
  }

  body.has-mobile-chrome .shell,
  body.has-mobile-chrome .app-shell,
  body.has-mobile-chrome .sportsbook-shell,
  body.has-mobile-chrome .stake-shell {
    padding-bottom: calc(20px + var(--mobile-nav-total));
  }

  body.has-side-nav .side-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100dvh;
    width: min(272px, 84vw);
    max-width: 84vw;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px 16px;
    gap: 8px;
    z-index: 980;
    transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, .38);
    will-change: transform;
  }

  body.mobile-side-nav-open .side-nav {
    transform: translateX(0);
  }

  body.has-side-nav .side-nav .nav-icon {
    display: inline-flex;
    align-items: center;
    width: 100%;
    height: 46px;
    border-radius: 10px;
    justify-content: flex-start;
    padding: 0 14px;
    gap: 12px;
  }

  body.has-side-nav .side-nav .nav-icon::after {
    content: attr(title);
    font-size: 13px;
    font-weight: 800;
  }

  body.has-side-nav .shell.sportsbook-shell,
  body.has-side-nav .shell.stake-shell {
    margin-left: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .sportsbook-shell {
    max-width: none;
    width: 100%;
  }

  .sportsbook-grid {
    display: block;
    width: 100%;
  }

  .sportsbook-main {
    width: 100%;
  }

  .layout-betslip-holder-bc.betslip-bc.mobile-betslip-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(440px, calc(100vw - 28px));
    max-height: min(86dvh, 720px);
    margin: 0;
    padding: 0;
    border-radius: 22px;
    border: 1px solid rgba(152, 104, 255, .42);
    transform: translate(-50%, -46%) scale(0.92);
    opacity: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
    box-shadow:
      0 28px 90px rgba(0, 0, 0, .58),
      0 0 0 1px rgba(255, 255, 255, .07) inset;
    background: linear-gradient(165deg, rgba(52, 32, 118, .98), rgba(20, 12, 52, .98)) !important;
    transition:
      transform .34s cubic-bezier(.34, 1.25, .64, 1),
      opacity .26s ease,
      visibility .26s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.mobile-betslip-open .layout-betslip-holder-bc.betslip-bc.mobile-betslip-modal {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.mobile-betslip-open .mobile-betslip-header {
    display: grid;
  }

  .mobile-betslip-modal .betslip-bc-inner {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mobile-betslip-modal .betslip-full-content-bc {
    max-height: min(38dvh, 320px);
    flex: 1;
    min-height: 100px;
  }

  .mobile-betslip-modal .betslip-footer-bc {
    border-radius: 0 0 22px 22px;
  }

  .mobile-betslip-modal .main-tabs-bc.bs-tabs-bc {
    background: rgba(0, 0, 0, .18);
  }

  .mobile-betslip-modal .bs-place-bet-bc {
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .01em;
  }

  body.stake-style-page .main-tabs-bc .tab-bc.active::after,
  body.has-mobile-chrome .main-tabs-bc .tab-bc.active::after {
    background: linear-gradient(90deg, #8d55ff, #22df4f);
  }

  body.has-mobile-chrome .bs-place-bet-bc {
    background: linear-gradient(135deg, #8d55ff, #22df4f);
    color: #fff;
  }

  body.has-mobile-chrome .betslip-count-badge {
    background: rgba(141, 85, 255, .22);
    color: #d4b8ff;
  }
}

@media (min-width: 900px) {
  body.mobile-side-nav-open .mobile-overlay {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-betslip-header,
  .mobile-betslip-grab-wrap {
    display: none !important;
  }
}
@media (max-width: 899px) {
  html {
    scrollbar-gutter: stable;
  }

  html,
  body.has-mobile-chrome,
  body.has-side-nav {
    overflow-x: hidden;
    max-width: 100%;
  }

  .app-shell,
  .layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar,
  .site-topbar,
  .sportsbook-topbar,
  .stake-topbar {
    max-width: 100%;
    min-width: 0;
  }

  .brand {
    min-width: 0;
  }

  .site-topbar .profile-area,
  .site-topbar .header-user-cluster.profile-area {
    min-width: min-content;
    flex-shrink: 0;
  }

  body:not(.logged-in) .site-topbar .site-topbar-auth.auth {
    min-width: min-content;
    flex-shrink: 0;
  }

  body:not(.logged-in) .site-topbar .auth-actions {
    flex-shrink: 0;
  }

  .logo {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sport-filters-list--horizontal,
  .competition-hub__track,
  .stake-market-tabs,
  .special-options,
  .dashboard-tabs {
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
}

/* Sports header + betslip modal overflow (mobile) */
@media (max-width: 899px) {
  .layout-betslip-holder-bc.betslip-bc.mobile-betslip-modal {
    width: min(440px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }

  .mobile-betslip-modal .betslip-footer-bc,
  .mobile-betslip-modal .main-tabs-bc.bs-tabs-bc,
  .mobile-betslip-modal .bs-f-header-bc {
    min-width: 0;
    max-width: 100%;
  }

  .mobile-betslip-modal .bs-numbers-bc {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-betslip-modal .main-tabs-bc .tab-bc {
    font-size: 11px;
    padding: 10px 4px;
  }
}

/* Final global header mobile layout. This file loads after site-header.css. */
@media (max-width: 899px) {
  header.topbar.site-topbar.home-topbar,
  header.topbar.site-topbar.sportsbook-topbar,
  header.topbar.site-topbar.stake-topbar {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 8px 10px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    overflow: visible !important;
    padding-top: 4px !important;
  }

  header.topbar.site-topbar .home-topbar-row,
  header.topbar.site-topbar .site-topbar-left,
  header.topbar.site-topbar .sportsbook-topbar-start {
    display: contents !important;
  }

  header.topbar.site-topbar .logo,
  header.topbar.site-topbar a.logo.site-brand-logo {
    display: flex !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    align-self: center !important;
    width: auto !important;
    max-width: min(72vw, 240px) !important;
    margin: 0 auto 2px !important;
    min-height: 36px !important;
  }

  header.topbar.site-topbar .menu-button {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    z-index: 2 !important;
  }

  header.topbar.site-topbar > .site-topbar-auth,
  header.topbar.site-topbar > .home-topbar-auth {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    justify-self: stretch !important;
    align-self: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    overflow: visible !important;
  }

  body:not(.logged-in) header.topbar.site-topbar.home-topbar,
  body:not(.logged-in) header.topbar.site-topbar.sportsbook-topbar,
  body:not(.logged-in) header.topbar.site-topbar.stake-topbar {
    grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  body:not(.logged-in) header.topbar.site-topbar .auth-actions {
    display: contents !important;
  }

  body:not(.logged-in) header.topbar.site-topbar > .site-topbar-auth,
  body:not(.logged-in) header.topbar.site-topbar > .home-topbar-auth {
    display: contents !important;
  }

  body:not(.logged-in) header.topbar.site-topbar .auth-actions .pill {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.logged-in) header.topbar.site-topbar #siteLoginBtn {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  body:not(.logged-in) header.topbar.site-topbar #siteRegisterBtn {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }

  body:not(.logged-in) header.topbar.site-topbar {
    justify-content: start !important;
  }
}

@media (max-width: 360px) {
  header.topbar.site-topbar .logo,
  header.topbar.site-topbar a.logo.site-brand-logo {
    max-width: min(68vw, 200px) !important;
  }

  body:not(.logged-in) header.topbar.site-topbar .auth-actions .pill {
    font-size: 11px !important;
    padding: 0 6px !important;
  }
}
