/* =========================================================
   Responsive overrides for the desktop (fullview) layout.
   Loaded after all other styles on every page.
   ========================================================= */

/* Never allow sideways page scroll */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; }

/* ---------- Tablet & below (<=1024px) ---------- */
@media (max-width: 1024px) {
  /* Drop the 1024px desktop min-width */
  .layout-fullview__body,
  .layout-fullview__content { min-width: 0 !important; }
  .layout-fullview > .layout-fullview__wrapper { overflow-x: hidden !important; }

  .main-page__body { max-width: 100% !important; }

  /* Header: let the top links scroll instead of overflowing */
  .header-fullview { padding-right: 8px; }
  .header-fullview > .header-fullview__head { flex: 1 1 auto !important; min-width: 0; }
  .header-fullview-head-link {
    min-width: 0; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .header-fullview-head-link::-webkit-scrollbar { display: none; }

  /* Footer */
  .footer-fullview { max-width: 100% !important; }
  .footer-links__ul { flex-wrap: wrap; }
  .footer-links__li { width: 50% !important; }
  .footer-fullview__row-wrap { flex-wrap: wrap; }
  .footer-fullview app-gaming-license + app-icon-lists { padding-left: 0 !important; }
  .footer-fullview app-gaming-license,
  .footer-fullview app-icon-lists { width: 100% !important; flex: 1 1 100% !important; }
}

/* ---------- Phones (<=768px) ---------- */
@media (max-width: 768px) {
  /* ----- Header ----- */
  .header-fullview {
    --header-fullview-height: 56px;
    height: 56px !important;
    padding-left: 8px !important;
    padding-right: 8px;
    align-items: center;
  }
  .header-fullview-head-menu { margin-inline-end: 6px !important; }
  .header-fullview-head-menu__icon { width: 38px !important; height: 38px !important; }
  .header-fullview-head-menu__img { width: 20px !important; height: 20px !important; }
  .header-fullview__logo { height: 46px !important; width: auto; flex: none; }
  /* logo + sponsor slideshow stay together on the left */
  .header-fullview > .header-fullview__head { flex: 0 1 auto !important; }
  .header-fullview__left-template { margin-inline-start: 2px !important; }
  .header-fullview__left-template,
  .header-fullview-head-link,
  .layout-fullview__header-customize { display: none !important; }

  /* buttons on the right next to the flag */
  .header-fullview > .header-fullview__body {
    flex: 1 1 auto !important; min-width: 0; margin: 0 !important;
    display: flex !important; align-items: center;
  }
  /* buttons sit on the right, just before the flag */
  .header-fullview__body > .header-fullview__right-template { margin-inline: auto 4px !important; }
  .header-fullview__button-wrapper { gap: 6px; }
  .header-fullview__button-wrapper > .header-fullview__button + .header-fullview__button { margin-inline-start: 0 !important; }
  .header-fullview-button {
    width: auto !important; min-width: 64px;
    height: 34px !important; padding: 0 12px !important;
    font-size: 13px !important; white-space: nowrap;
  }
  .header-fullview__lang { display: block !important; flex: none; padding: 0 0 0 6px !important; }
  .language-picker { width: 26px !important; height: 26px !important; }
  .language-picker__img { width: 26px !important; height: 26px !important; }

  /* ----- Side nav becomes an off-canvas drawer ----- */
  /* transform on the parent would trap position:fixed children */
  .layout-fullview__body { transform: none !important; }
  .layout-fullview__body > .layout-fullview__side-nav {
    background: var(--side-nav-bg, #1b1d1d);
    box-shadow: 8px 0 24px rgba(0,0,0,.5) !important;
    position: fixed !important;
    top: 56px; bottom: 0; left: 0;
    z-index: 50;
    width: 280px !important; max-width: 82vw;
    transform: translateX(-105%);
    transition: transform .28s ease;
    border-right: 0 !important;
  }
  [dir=rtl] .layout-fullview__body > .layout-fullview__side-nav { left: auto; right: 0; transform: translateX(105%); }
  html.rs-nav-open .layout-fullview__body > .layout-fullview__side-nav { transform: none; }

  .layout-fullview__side-nav .side-nav { width: 100% !important; height: 100%; }
  .layout-fullview__side-nav .side-nav__scrollable { overflow-y: auto !important; height: 100%; -webkit-overflow-scrolling: touch; }

  /* Show labels inside the drawer (Angular collapses them to width:0 inline) */
  .layout-fullview__side-nav .side-menu-item__title,
  .layout-fullview__side-nav .side-menu-item__right,
  .layout-fullview__side-nav .side-menu-collapse__title,
  .layout-fullview__side-nav .side-menu-toolkit-btn__text {
    width: auto !important; opacity: 1 !important; visibility: visible !important;
    white-space: nowrap;
  }
  .layout-fullview__side-nav .side-menu-item,
  .layout-fullview__side-nav .side-menu-item__main { justify-content: flex-start !important; }
  .layout-fullview__side-nav .side-menu-item__title,
  .layout-fullview__side-nav .side-menu-collapse__title { margin-inline-start: 12px; font-size: 14px; color: var(--neutral200, #e2e6e9); }
  .layout-fullview__side-nav .side-menu-collapse__main { justify-content: flex-start !important; }

  /* Drawer backdrop */
  .rs-nav-backdrop {
    position: fixed; inset: 56px 0 0 0; z-index: 49;
    background: rgba(0,0,0,.55);
    opacity: 0; pointer-events: none; transition: opacity .28s ease;
  }
  html.rs-nav-open .rs-nav-backdrop { opacity: 1; pointer-events: auto; }
  html.rs-nav-open, html.rs-nav-open body { overflow: hidden; }

  /* Content takes full width now */
  .layout-fullview__body > .layout-fullview__scrollable { width: 100%; -webkit-overflow-scrolling: touch; }
  .layout-fullview__body > .layout-fullview__panel-slot:not(.layout-fullview__panel-slot--hidden) {
    position: fixed; inset: 56px 0 0 0; width: 100% !important; z-index: 60;
  }

  /* ----- Main page ----- */
  .main-page__body { padding: 0 10px !important; }
  .main-page__labeled-carousel { padding: 0 !important; }
  html .main-page__labeled-carousel--provider,
  html .main-page__labeled-carousel--event,
  html .main-page__labeled-carousel--feature-games { --label-carousel-main-width: 100% !important; }

  /* All carousels: drop the desktop pixel transforms and use native swipe + snap */
  .carousel-frame-alpha__track { transform: none !important; }
  .carousel-frame-alpha__shell {
    overflow-x: auto !important; overflow-y: hidden !important;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  .carousel-frame-alpha__shell::-webkit-scrollbar { display: none; }
  .carousel-frame-alpha__unit--duplicated { display: none !important; }
  .carousel-frame-alpha__unit { scroll-snap-align: start; height: auto !important; }
  .carousel-frame-alpha__navigation,
  .labeled-carousel-label__navigation { display: none !important; }

  /* Hero banner — the images are 3840x420 desktop banners whose real content
     (people + text) sits in the middle ~1700px. On phones show exactly that
     middle part at its true proportions instead of a fixed 150px crop. */
  .carousel-fullview-banner .carousel-frame-alpha__unit { width: 100% !important; margin-inline-start: 0 !important; }
  .carousel-fullview-banner-unit__pic {
    height: auto !important; aspect-ratio: 1500 / 420;
    position: relative; overflow: hidden;
  }
  .carousel-fullview-banner-unit__pic .fullview-banner {
    position: absolute; inset: 0; width: 100% !important; height: 100% !important;
    -webkit-mask: none !important; mask: none !important;   /* no edge fade on small screens */
  }
  .carousel-fullview-banner-unit__pic img.fullview-banner__image {
    position: absolute; top: 0; left: 50%; transform: translateX(-52%); /* text sits a bit right of centre */
    height: 100% !important; width: auto !important; max-width: none !important;
    -webkit-mask: none !important; mask: none !important;
  }

  /* Sports odds widget (3rd-party) must not exceed the screen */
  .match-odds-panel, .match-odds-panel__widget { max-width: 100%; overflow: hidden; }
  .carousel-fullview-banner__navigation { display: none !important; }

  /* Labeled carousels: show fewer, bigger cards */
  .labeled-carousel__main { width: 100% !important; }
  .main-page__labeled-carousel--provider .carousel-frame-alpha__unit { width: calc(33.333% - 6px) !important; }
  .main-page__labeled-carousel--event .carousel-frame-alpha__unit { width: 86% !important; }
  .main-page__labeled-carousel--feature-games .carousel-frame-alpha__unit { width: calc(31% - 6px) !important; }

  .marquee { font-size: 13px; }

  .main-nav__category { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav__category::-webkit-scrollbar { display: none; }
  html .main-nav-games-banner { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }

  /* Provider grid inside each game tab: 3 columns, icon above the name */
  html .main-nav-games-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  html .main-nav-games-grid-cell {
    width: auto !important; min-width: 0; height: auto !important; min-height: 72px;
    padding: 10px 4px !important; margin: 0 !important;
    display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  }
  html .main-nav-games-grid-cell__icon { margin: 0 !important; }
  html .main-nav-games-grid-cell__text {
    margin: 0 !important; font-size: 12px !important; line-height: 1.2;
    white-space: normal !important; overflow-wrap: anywhere; width: 100%;
  }

  /* ----- Footer ----- */
  .footer-fullview { padding: 0 14px !important; }
  .footer-links__li { width: 50% !important; }
  .footer-links-item__head { padding: 14px 0 8px !important; font-size: 15px; }
  .footer-links-item-content__item { padding: 7px 0 !important; font-size: 14px; }

  .ambassador-lists__item,
  html.is-desktop .ambassador-lists__item { width: 50% !important; margin-right: 0 !important; padding-right: 8px; box-sizing: border-box; }

  .footer-fullview__row-wrap { flex-direction: column; }
  .icon-lists__item, .gaming-license__item { margin: 0 14px 10px 0 !important; }

  .social-media-list__wrap { flex-wrap: wrap; gap: 8px; }

  .footer-fullview__brand { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .footer-fullview .brand__logo { margin-right: 0 !important; }
  .footer-fullview .license__title,
  .footer-fullview .license__content,
  .footer-fullview-description__txt { font-size: 13px !important; overflow-wrap: anywhere; }

  /* Floating widgets: keep them small and out of the way */
  .drag-drop-box .float-wrap-btn__img { width: 44px !important; height: 44px !important; }
  #btnLuckyspin { transform: scale(.8); transform-origin: bottom right; }
}

/* ---------- Large phones / small tablets (481-768px) ---------- */
@media (min-width: 481px) and (max-width: 768px) {
  html .main-nav-games-banner { grid-template-columns: repeat(6, 1fr) !important; }
  html .main-nav-games-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .main-page__labeled-carousel--provider .carousel-frame-alpha__unit { width: calc(25% - 6px) !important; }
  .main-page__labeled-carousel--event .carousel-frame-alpha__unit { width: calc(50% - 6px) !important; }
  .main-page__labeled-carousel--feature-games .carousel-frame-alpha__unit { width: calc(20% - 7px) !important; }
  .main-page__body { padding: 0 16px !important; }
}

/* ---------- Small phones (<=380px) ---------- */
@media (max-width: 380px) {
  .header-fullview__logo { height: 42px !important; }
  .header-fullview-button { min-width: 54px; padding: 0 8px !important; font-size: 12px !important; }
  .header-fullview__lang { padding: 0 0 0 4px !important; }
  .language-picker, .language-picker__img { width: 22px !important; height: 22px !important; }
  .footer-links__li { width: 100% !important; }
  .ambassador-lists__item,
  html.is-desktop .ambassador-lists__item { width: 100% !important; }
  html .main-nav-games-banner { gap: 6px; }
}

/* The saved sub pages still contain the app's loading screen (normally removed
   by the app's JavaScript, which isn't there) — never show it. */
app-loading.app__loading, .app__loading .loading { display: none !important; }

/* ---------- Desktop (>=769px): content fills the space next to the side menu ----------
   The saved layout fixes the content at 1200px (left-aligned) and some pages
   also fix the scroll area's width, which left an empty strip on the right. */
@media (min-width: 769px) {
  .layout-fullview__scrollable { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; }
  .layout-fullview__content,
  .layout-fullview__router-animation-wrapper {
    width: 100% !important; min-width: 0 !important; max-width: 1440px !important;
    margin-left: auto !important; margin-right: auto !important; box-sizing: border-box;
  }
}

/* Sub pages were saved mid page-transition: the layout wrapper is left
   position:absolute, so it only takes the width of its content. */
.app > app-layout-fullview { position: relative !important; display: block; width: 100% !important; left: auto !important; right: auto !important; }

