/* Sport1 Altenar + Sport2 Digitain — mobile + desktop shell */

app-sport {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  position: relative;
}

app-sport.sport-mobile {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Placeholder SoftSwiss nodes steal flex height — hide when iframe is used */
app-sport.sport-mobile > #gameholder,
app-sport.sport-mobile > #bia-sports-frame,
app-sport.sport-mobile > #sportsbook-container {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

app-sport.sport-mobile > .d-flex,
app-sport.sport-mobile > div.d-flex {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

app-sport.sport-mobile iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: 0 !important;
}

/* Desktop / web: iframe fills the page; hide empty SoftSwiss placeholders
   that otherwise leave a black void under Altenar/Digitain. */
app-sport.sport-desktop,
app-sport:not(.sport-mobile) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  position: relative !important;
  width: 100% !important;
  min-height: 0 !important;
  height: calc(100dvh - 64px) !important;
  max-height: calc(100dvh - 64px) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0b0f1a !important;
}

.app-sport-desktop-hide,
app-sport.sport-desktop > #gameholder,
app-sport.sport-desktop > #sportsbook-container,
app-sport.sport-desktop > #bia-sports-frame,
app-sport:not(.sport-mobile) > #gameholder,
app-sport:not(.sport-mobile) > #sportsbook-container,
app-sport:not(.sport-mobile) > #bia-sports-frame {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

app-sport.sport-desktop > .d-flex,
app-sport.sport-desktop > div.d-flex,
app-sport:not(.sport-mobile) > .d-flex,
app-sport:not(.sport-mobile) > div.d-flex,
app-sport.sport-desktop [container],
app-sport:not(.sport-mobile) [container] {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

app-sport.sport-desktop iframe,
app-sport:not(.sport-mobile) iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: 0 !important;
  background: #0b0f1a !important;
}

@media (min-width: 1024px) {
  .page-content:has(app-sport),
  .content-wrapper:has(app-sport),
  .content-inner:has(app-sport) {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }

  body:has(app-sport) .page-content,
  body:has(app-sport) .content-wrapper {
    min-height: calc(100dvh - 64px) !important;
  }

  /* Footer should not sit under a short sports iframe */
  body:has(app-sport.sport-desktop) app-footer,
  body:has(app-sport:not(.sport-mobile)) app-footer {
    display: none !important;
  }
}

@media (max-width: 1023.98px) {
  .page-content:has(app-sport),
  .content-wrapper:has(app-sport),
  .content-inner:has(app-sport) {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }

  app-sport {
    height: calc(100dvh - 112px) !important;
    max-height: calc(100dvh - 112px) !important;
  }

  /* Keep Altenar betslip clear of bottom nav */
  app-sport ._asb_betslip-link-container {
    bottom: 72px !important;
  }

  /* Casino play iframe — fill the phone viewport (height:100% collapses on iOS) */
  .page-content:has(app-play),
  .content-wrapper:has(app-play),
  .content-inner:has(app-play),
  router-outlet + app-play,
  app-play {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  app-play {
    position: relative !important;
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  app-play > div,
  app-play [container],
  app-play .d-flex.h-100 {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  app-play iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    border: 0 !important;
    background: #000 !important;
  }

  /* Hide chrome that steals height while a game is open */
  body:has(app-play) .navbar-bottom,
  body:has(app-play) app-footer,
  body:has(app-play) .bottom-nav {
    display: none !important;
  }
}
