/*
 * Structural host only — replaces missing ion-content scroll + full-height shell.
 * Does not restyle colors/typography; enables original .page-body overflow-y:auto.
 */
html,
body,
#root {
  height: 100%;
  margin: 0;
}

/* Match prod app-root: dark outside the 768 shell (never yellow side frames). */
#root {
  background: var(--grey-00, #111111);
}

#root > mat-sidenav-container.mat-drawer-container,
#root > .mat-drawer-container.mat-sidenav-container {
  height: 100%;
  max-width: 768px;
  margin: 0 auto;
  display: block;
  overflow: hidden;
}

#root mat-sidenav-content.mat-drawer-content,
#root .mat-drawer-content.mat-sidenav-content {
  height: 100%;
  display: block;
}

#root .main {
  height: 100%;
}

#root .main > .container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  /*
   * Bootstrap main.4c3529e2.css sets .container { padding:0 15px; max-width:1200px }.
   * Prod styles.6050 zeroes padding and caps at 768. Without this, yellow
   * --secondary-color on .main>.container shows as L/R gutters beside .page-body.
   */
  padding-left: 0;
  padding-right: 0;
  max-width: 768px;
  width: 100%;
  box-sizing: border-box;
}

/*
 * Homepage keeps yellow shell (wallet header). Inner routes (sports/casino/…)
 * match prod: container background is grey-00, not secondary yellow.
 */
#root .main > .container:not(:has(.wallet-wrapper)) {
  background: var(--grey-00, #111111);
}

/*
 * Fill the flex column below `.page-header` / above footer. Do NOT override
 * gopanel-components `height:100%` with `height:auto` — that collapses the
 * scroll shell to 0px and exposes the yellow `.container` background.
 */
#root .page-body {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /*
   * component-profile-page.css sets .page-body { margin-bottom:120px } without
   * Angular encapsulation. Prod only uses 60px (footer height). Extra 60px of
   * margin sits above the fixed footer and exposes yellow .container on home.
   */
  margin-bottom: 60px;
}

/* Profile/payment shells that need taller clearance under stacked chrome */
#root .page-body:has(.user-bal-info),
#root .page-body:has(.user-payment-info) {
  margin-bottom: 120px;
}

/*
 * Without Ionic runtime, ion-content stays display:inline and blows out layout
 * (15px baseline gap + full document height). Prod hydrated ion-content is
 * display:block, position:relative, min-height:100% inside the scroll shell.
 */
#root .page-body ion-content {
  display: block;
  min-height: 100%;
  position: relative;
}

/* Ensure drawer panel uses theme surface when opened over content */
#root .mat-sidenav-container > .mat-drawer.left-sidemenu {
  background: var(--grey-00);
}

#root .mat-sidenav-container .left-sidemenu .smenu-link {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
}

/*
 * Guard: global `.not-loggedIn{display:flex}` (from de-encapsulated Angular CSS)
 * must never lay out `.page-header` as a row.
 */
#root .page-header {
  display: block;
}

/*
 * styles.6050 sets:
 *   .page-header { margin-bottom: 30px }
 *   .page-header.not-loggedIn { margin-bottom: 15px !important }
 * Homepage zeroes via component-13 [_ngcontent] / :has(.wallet-wrapper).
 * Inner SubHeader routes lack those selectors, so the 15px margin paints as a
 * black strip (grey-00 .container) between the 44px header and
 * .forSearchBar-internal. Prod Angular keeps header→search flush (gap 0).
 * Scope to non-wallet headers only — do not disturb homepage yellow shell.
 */
#root .page-header:not(:has(.wallet-wrapper)) {
  margin-bottom: 0;
}
/* Mirror component-13's !important zero — required to beat styles.6050 guest rule. */
#root .page-header.not-loggedIn:not(:has(.wallet-wrapper)) {
  margin-bottom: 0 !important;
}

/* Banner bullets — original uses swiper ::part(); we mirror the look */
#root .page-banner {
  position: relative;
}
#root .page-banner swiper-container {
  display: block;
  /* Prod swiper shadow slot reserves ~4px for horizontal pagination bullets. */
  padding-bottom: 4px;
}
#root .page-banner .img-wrap {
  line-height: 0;
}
#root .page-banner .img-wrap img {
  display: block;
}
#root .page-banner .banner-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  margin-top: 0;
  z-index: 2;
  pointer-events: auto;
}
#root .page-banner .banner-bullet {
  width: 15px;
  height: 3px;
  border: none;
  padding: 0;
  border-radius: 0;
  background: var(--black-color);
  cursor: pointer;
}
#root .page-banner .banner-bullet.active {
  background: var(--secondary-color);
}

/* Light-DOM mat-tab stubs — prod Angular lazy chunks style mat-tab-header children */
#root .sports-tabs-group mat-tab-header .mat-mdc-tab-labels,
#root .inplay-page-wrap mat-tab-header .mat-mdc-tab-labels,
#root .pagetab-body mat-tab-header .mat-mdc-tab-labels,
#root .ids-tabnav mat-tab-header .mat-mdc-tab-labels {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}
#root .sports-tabs-group mat-tab-header .mat-mdc-tab-labels .mdc-tab,
#root .inplay-page-wrap mat-tab-header .mat-mdc-tab-labels .mdc-tab,
#root .pagetab-body mat-tab-header .mat-mdc-tab-labels .mdc-tab,
#root .ids-tabnav mat-tab-header .mat-mdc-tab-labels .mdc-tab {
  flex: 1 0 auto;
  max-width: none;
}

/*
 * MDC tab underline base (normally from Angular Material). Without
 * border-top-style:solid, styles.6050… border-width/color cannot paint.
 */
#root mat-tab-header .mdc-tab-indicator__content--underline {
  border-top-style: solid;
}

/*
 * Sports match cards sit on white surfaces while .page-body inherits light
 * text from the shell — force readable ink on the card.
 */
#root .matches-wrap .game-card {
  color: #111;
}
#root .matches-wrap .game-card .tournament-title,
#root .matches-wrap .game-card .score-info h3,
#root .matches-wrap .game-card .score-info p {
  color: #111;
}

/* Schedule chip: original rule used same --primary for bg+text (invisible). */
#root .matches-wrap .game-card.w-icon-view .schedule-time {
  color: #fff;
  background: #111;
  border-radius: 12px;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* Prod INPLAY / UPCOMING count badges on sports pagetab */
#root .pagetab-body mat-tab-header .tab-count-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 4px;
  background: var(--white-color);
  color: var(--black-color);
  font-size: 10px;
  line-height: 16px;
  font-family: open_bold, sans-serif;
}

/*
 * Wallet grid is production-owned (300px / 1fr 2fr 1fr). On narrow phones
 * ensure the host shell never forces horizontal overflow from the grid.
 */
#root .wallet-wrapper {
  overflow-x: hidden;
  max-width: 100%;
}

/*
 * Home `.btnWrap` column parity with `.global-search-modal.onHomepage`.
 *
 * Prod Angular only ships styles.6050 (no Bootstrap utilities), so
 * `.create-btn.full-width.mb-5` computes margin-bottom:0 and btnWrap height:45.
 * Our main.4c3529e2.css applies `.mb-5{margin-bottom:3rem!important}`, inflating
 * btnWrap to ~88px and breaking the create-acc → search vertical rhythm that
 * makes the shared 14px content column read as misaligned.
 */
#root .page-body .create-acc .btnWrap > .create-btn.mb-5 {
  margin-bottom: 0 !important;
}

/*
 * Flex-era home tiles: each `.hGame-btn-wrap` is a flex:1 slot. The older
 * absolute rule `width:calc(50% - 5px); right:0` targeted direct btnWrap
 * children; fill the slot so left/right edges stay flush with search.
 */
#root .page-body .create-acc .btnWrap .hGame-btn-wrap > .jetBtnWrap {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: auto;
}

/*
 * Placebet (/sports/:sport/:id, /placebet) — structural scroll + tab chrome.
 * Visual rules live in component-app-placebet.css (prod Angular extract).
 * DOM: app-game-placebet > .page-body.notranslate > .game-tab
 */
#root app-game-placebet .page-body,
#root .page-body:has(.game-tab) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#root app-game-placebet .game-tab,
#root .page-body .game-tab {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}
#root app-game-placebet .game-tab .mat-mdc-tab-body-wrapper,
#root .page-body .game-tab .mat-mdc-tab-body-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#root app-game-placebet .game-tab mat-tab-header .mat-mdc-tab-labels,
#root .page-body .game-tab mat-tab-header .mat-mdc-tab-labels {
  display: flex;
  width: 100%;
}
#root app-game-placebet .game-tab mat-tab-header .mdc-tab,
#root .page-body .game-tab mat-tab-header .mdc-tab {
  flex: 1 0 auto;
}
#root app-game-placebet .count-value.back-count,
#root app-game-placebet .count-value.lay-count,
#root .page-body .game-tab .count-value.back-count,
#root .page-body .game-tab .count-value.lay-count {
  color: #000;
  --mdc-filled-button-label-text-color: #000;
}
#root app-game-placebet .count-value.back-count h4,
#root app-game-placebet .count-value.lay-count h4,
#root .page-body .game-tab .count-value.back-count h4,
#root .page-body .game-tab .count-value.lay-count h4 {
  color: #000;
  margin: 0;
}
/* Betslip dialog host (no Angular CDK portal) — above sticky footer / WhatsApp */
#root .cdk-overlay-container {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}
#root .cdk-overlay-container .cdk-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
#root .cdk-overlay-container .cdk-global-overlay-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
#root .cdk-overlay-container .cdk-overlay-pane.betslip-dialog {
  pointer-events: auto;
  z-index: 10051;
  margin-bottom: 72px !important;
}
#root .cdk-overlay-container .betslip-modal .slip-btn {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
