/* 888 Dragon Lotto D1 Player protected preview – mobile polish v2.
   Display-only; no payment/auth/game network changes. Source: original 223-file owner build.
   Effective after all historical player-styles-v3.10.172.css overrides.
*/
:root { --d1-mobile-bottom-space: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* A removed published logo must never expose alt-text from an image without src. */
html body .brand-mark:not(.has-logo) picture,
html body .brand-mark:not(.has-logo) img,
html body .brand-mark img:not([src]),
html body .brand-mark img[src=""] { display:none !important; }
html body .brand-mark:not(.has-logo) .brand-fallback {
  display:flex !important; align-items:center !important; justify-content:center !important;
  width:100%; height:100%; overflow:hidden; text-align:center;
  white-space:nowrap; overflow-wrap:normal !important; word-break:normal !important;
  font-weight:850; font-size:clamp(15px,3.3vw,22px) !important; line-height:1;
}
html body #headerBrandMark:not(.has-logo) { overflow:hidden !important; }
html body #headerBrandHomeButton { min-width:0!important; }
html body .header-brand-copy { min-width:0!important; flex:1 1 auto; }
html body .header-brand-copy strong {
  display:block!important; overflow:hidden!important; text-overflow:ellipsis!important;
  white-space:nowrap!important; overflow-wrap:normal!important; word-break:normal!important;
}
/* Keep first-paint card neutral instead of briefly displaying the retired system logo. */
html body #featuredGamesGrid .d1-featured-unbranded {
  display:grid; place-items:center; width:100%; height:100%; min-height:120px;
  padding:16px; font-weight:800; letter-spacing:.06em; text-align:center;
  color:var(--theme-accent, #f1cb62); background:linear-gradient(130deg,#150b0d,#311018 62%,#120b0b);
  overflow-wrap:normal; word-break:normal;
}
html body #featuredGamesGrid .featured-game-media :is(img[src*="/system-logo"],img[src*="/optimized172/system-logo"],source[srcset*="/system-logo"],source[srcset*="/optimized172/system-logo"]) { display:none!important; }

/* Provider chips have finite columns. Never distribute 1 character per row. */
@media (max-width:860px) {
  html body #gameLobby #gameProviderList.game-provider-list {
    display:grid!important; grid-auto-flow:row!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-columns:auto!important; gap:10px!important;
    width:100%!important; max-width:100%!important; min-width:0!important;
    padding:4px 0 12px!important; overflow-x:clip!important;
    overflow-y:visible!important; scroll-snap-type:none!important;
  }
  html body #gameLobby #gameProviderList .provider-chip {
    box-sizing:border-box!important; display:flex!important;
    align-items:center!important; justify-content:center!important;
    min-width:0!important; width:100%!important; max-width:100%!important;
    min-height:54px!important; padding:12px 8px!important;
    white-space:normal!important; overflow-wrap:break-word!important;
    word-break:normal!important; hyphens:none!important;
    line-height:1.35!important; text-align:center!important;
    font-size:clamp(11px,2.8vw,14px)!important;
  }
  /* Keep the mobile drawer on-screen with its own scroll area above the bottom navigation. */
  html body #playerSidebar.sidebar {
    box-sizing:border-box!important; position:fixed!important; left:0!important;
    right:auto!important; top:0!important; bottom:0!important;
    width:min(88vw,350px)!important; min-width:0!important;
    max-width:calc(100vw - 14px)!important;
    height:100dvh!important; max-height:100dvh!important;
    padding:calc(12px + env(safe-area-inset-top,0px)) 14px var(--d1-mobile-bottom-space)!important;
    overflow-x:hidden!important; overflow-y:auto!important;
    overscroll-behavior:contain!important; -webkit-overflow-scrolling:touch;
    z-index:110!important; transform:translate3d(-110%,0,0)!important;
    transition:transform .18s ease-out!important;
  }
  html body #playerSidebar.sidebar.open { transform:translate3d(0,0,0)!important; }
  html body #playerSidebar .sidebar-header {flex:0 0 auto!important; min-width:0!important;}
  html body #playerSidebar .sidebar-nav {
    box-sizing:border-box!important; display:grid!important;
    width:100%!important; min-width:0!important; flex:0 0 auto!important;
    overflow:visible!important; padding-bottom:12px!important;
  }
  html body #playerSidebar .nav-button, html body #playerSidebar .nav-label {
    min-width:0!important; white-space:normal!important; overflow-wrap:normal!important;
  }
  html body .sidebar-backdrop.show {z-index:105!important;}
  html body .mobile-bottom-nav {z-index:120!important;}

  /* Auth content scrolls between the fixed header and bottom navigation.
     Header is not allowed to cover the logo or first form controls. */
  html body #authScreen.auth-screen:not(.hidden) {
    position:fixed!important; display:block!important;
    top:var(--d1-auth-top, calc(72px + env(safe-area-inset-top,0px)))!important;
    bottom:var(--d1-auth-bottom, var(--d1-mobile-bottom-space))!important;
    left:0!important; right:0!important;
    width:100%!important; height:auto!important; min-height:0!important;
    max-height:none!important; box-sizing:border-box!important;
    overflow-x:hidden!important; overflow-y:auto!important;
    padding:12px max(12px,env(safe-area-inset-left,0px)) 26px max(12px,env(safe-area-inset-right,0px))!important;
    overscroll-behavior:contain!important; -webkit-overflow-scrolling:touch!important;
    scroll-padding-top:12px; scroll-padding-bottom:50px;
    align-items:initial!important; place-items:initial!important;
  }
  html body #authScreen .auth-card {
    box-sizing:border-box!important; width:100%!important;
    max-width:520px!important; height:auto!important;
    max-height:none!important; overflow:visible!important;
    min-width:0!important; margin:0 auto 16px!important;
    padding:clamp(16px,4vw,26px)!important;
    transform:none!important; filter:none!important;
  }
  html body #authScreen .auth-card :is(form,.field,input,.auth-tabs) {max-width:100%;min-width:0;box-sizing:border-box;}
  html body #authScreen .auth-card input {width:100%;font-size:16px!important;}
  html body #authScreen .brand-row {min-width:0;overflow:hidden;padding-right:48px!important;}
  html body #authScreen .brand-name {max-width:100%;overflow:hidden;white-space:normal;overflow-wrap:normal;word-break:normal;}
  html body #authScreen .auth-title {font-size:clamp(22px,5.8vw,32px)!important;line-height:1.17!important;}
  html body #authScreen .auth-description {overflow-wrap:break-word;line-height:1.45;}
  html body #authScreen .auth-card .brand-mark:not(.has-logo) picture {display:none!important;}
  html body #authScreen .auth-close-button {z-index:2!important;}
}
@media (max-width:420px) {
  html body #gameLobby #gameProviderList.game-provider-list {gap:8px!important;}
  html body #gameLobby #gameProviderList .provider-chip {min-height:48px!important;padding:10px 6px!important;font-size:11px!important;}
  html body #headerBrandMark.header-brand-mark {
    flex:0 0 34px!important;width:34px!important;min-width:34px!important;
    height:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
  }
  html body .header-brand-copy strong {font-size:12px!important;line-height:1.2!important;}
  html body #authScreen.auth-screen:not(.hidden) {top:var(--d1-auth-top, calc(64px + env(safe-area-inset-top,0px)))!important;}
}
@media (prefers-reduced-motion:reduce) {
  html body #playerSidebar.sidebar {transition:none!important;}
}
