/* ═══════════════════════════════════════════════════════════════
   ALL GAMES — Black Liquid Glass (effects only)
   Tokens live in head :root. This sheet adds glare, glass surfaces,
   and the mobile scroll unlock — no theme !important wars.
═══════════════════════════════════════════════════════════════ */

/*
  SCROLL FIX (iOS/Android):
  Do NOT set overflow-y:auto on html+body — that creates nested scroll
  ports and freezes touch scroll. Keep overflow-y visible; only clip X.
*/
html,body{
  height:auto;
  max-height:none;
  min-height:100%;
  overflow-x:clip;
  overflow-y:visible;
  position:static;
  overscroll-behavior-y:none;
}

.layout,
.layout .main,
.main,
#page-home{
  overflow:visible;
  max-height:none;
  height:auto;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  isolation:auto;
  transform:none;
}

/* Ambient glare — desktop only */
@media (min-width:901px){
  body::after{
    content:'';
    position:fixed;inset:0;z-index:0;pointer-events:none;
    background:linear-gradient(
      105deg,
      transparent 35%,
      rgba(255,255,255,.03) 48%,
      rgba(201,168,76,.03) 52%,
      transparent 65%
    );
    background-size:220% 100%;
    animation:lgPageGlare 9s ease-in-out infinite;
    mix-blend-mode:screen;
    opacity:.5;
  }
}
@keyframes lgPageGlare{
  0%{background-position:120% 0;opacity:.1;}
  40%{opacity:.4;}
  100%{background-position:-40% 0;opacity:.1;}
}

/* Glass on cards only — never .layout / .main; topnav stays solid via --nav-bg */
.lg-glass,
.sb-match-row,
.game-card,
.lobby-card,
.hlc-card,
.rtab-game-card,
.rtab-live-card,
.live-casino-card,
.home-credit-card,
.auth-modal .auth-box,
.rsb-sport-tile,
.cx-card,
.live-card{
  position:relative;
  background:var(--glass-bg);
  border-color:var(--glass-border);
  box-shadow:var(--glass-shadow);
}
@media (min-width:901px){
  .lg-glass,
  .topnav,
  .sb-match-row,
  .game-card,
  .lobby-card,
  .hlc-card,
  .rtab-game-card,
  .live-casino-card,
  .home-credit-card,
  .rsb-sport-tile,
  .cx-card,
  .live-card{
    backdrop-filter:blur(12px) saturate(1.05);
    -webkit-backdrop-filter:blur(12px) saturate(1.05);
    isolation:isolate;
  }
  .lg-glass::before,
  .sb-match-row .sb-glass::before,
  .game-card::after,
  .lobby-card::after,
  .hlc-card::after,
  .rtab-game-card::after,
  .rsb-sport-tile::after,
  .home-credit-card::after{
    content:'';
    position:absolute;top:-30%;bottom:-30%;left:0;width:42%;
    pointer-events:none;z-index:2;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.1),rgba(201,168,76,.05),transparent);
    animation:lgSurfaceGlare 5.6s ease-in-out infinite;
    opacity:0;
  }
}
@keyframes lgSurfaceGlare{
  0%{transform:translateX(-140%) skewX(-14deg);opacity:0;}
  18%{opacity:.45;}
  45%{opacity:.1;}
  100%{transform:translateX(220%) skewX(-14deg);opacity:0;}
}

.auth-modal-backdrop.open,
.wallet-backdrop.open,
.sidebar-overlay.show,
.notif-overlay.show,
.lucky-spin-overlay.show{
  background:rgba(0,0,0,.78);
}

/* Mobile: scroll unlock + kill content-visibility scroll-height bugs */
@media (max-width:900px){
  html,body{
    overflow-x:clip;
    overflow-y:visible;
    height:auto;
    max-height:none;
    position:static;
    touch-action:manipulation;
  }
  body:not(.sidebar-open):not(.wallet-open){
    overflow:visible;
  }
  .layout,.main,#page-home{
    overflow:visible;
    height:auto;
    max-height:none;
    touch-action:manipulation;
  }
  .featured-section,
  .search-bar,
  .search-results-panel,
  #casinoSliders,
  #latestGamesSection,
  .rtab-main-wrapper,
  .providers-row,
  #page-home .section:not(:first-child){
    content-visibility:visible;
    contain:none;
    contain-intrinsic-size:none;
  }
  #site-loader.hidden{
    pointer-events:none;
    display:none;
  }
}

@media (prefers-reduced-motion:reduce){
  body::after{display:none;}
}
