/* Lite mode (html.snk-lite, set by perf-lite.js) for old / slow computers. Loaded last on lobby and play pages.
   Removes only effects that cost the graphics chip every frame: blur behind glass panels (re-blurs the moving
   table under it), looping animations and long transitions. Layout, colours and gameplay stay the same. */
html.snk-lite *,
html.snk-lite *::before,
html.snk-lite *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  animation-delay: 0s !important;
  transition-duration: .01ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

/* v17: MacBooks on game screens (perf-lite.js): no blurred glass behind panels; everything else unchanged. */
html.snk-mac-game *,
html.snk-mac-game *::before,
html.snk-mac-game *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* v21 smooth play on laptops. In cascade layer "snk-perf" (declared first in <head> on games/*.html and play/*.html),
   so these win over the layered !important animation rules of the older skins.
   1. PC game screens (html.snk-pc-game, perf-lite.js): no blur behind panels over the 3D table. Each blurred panel
      had to be re-blurred every time the table redrew (every frame of a stroke or shot).
   2. While the table moves (html.snk-busy, set by the play page during a stroke / shot / rolling balls): decorative
      loops (background waves, button shine, badge glow) pause; they carry on when the balls stop.
   3. Lobby while a game is open in front of it (html.snk-playing, games/*.js): the lobby underneath is not drawn. */
@layer snk-perf {
  html.snk-pc-game *,
  html.snk-pc-game *::before,
  html.snk-pc-game *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

  html.snk-busy body::before,
  html.snk-busy body::after,
  html.snk-busy [class*="snk-pp-"],
  html.snk-busy [class*="snk-pp-"]::before,
  html.snk-busy [class*="snk-pp-"]::after { animation-play-state: paused !important; }
  /* Nov 2026: the admin / mod / VIP badge glow (role-badges.css .rk-halo) is never paused or frozen, on any graphics
     setting: it is one tiny layer whose opacity fades, so it costs next to nothing beside the table. */

  html.snk-playing body > :not(#snk-game) { visibility: hidden !important; }
  html.snk-playing body > :not(#snk-game) *,
  html.snk-playing body > :not(#snk-game) *::before,
  html.snk-playing body > :not(#snk-game) *::after { animation-play-state: paused !important; }
  html.snk-playing body::before,
  html.snk-playing body::after { display: none !important; }

  /* 4. Nov 2026: PC game screens: glows that pulsed for the whole game (also while aiming) are held still.
     The active scorecard's pulse animated box-shadow and the role badges / rank icons animated drop-shadow
     filters, which the browser repaints on every frame next to the 3D table. The look is their brightest frame. */
  html.snk-pc-game #score-overlay .scorecard.active {
    animation: none !important;
    box-shadow: 0 0 14px 1px rgba(83,233,255,.3), inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 20px rgba(83,233,255,.24) !important;
  }
  html.snk-pc-game .badge.admin { animation: none !important; filter: drop-shadow(0 0 2px #e6c14a) drop-shadow(0 0 4px rgba(201,162,39,.45)) !important; }
  html.snk-pc-game .badge.mod { animation: none !important; filter: drop-shadow(0 0 2px #9aacbf) drop-shadow(0 0 4px rgba(125,142,163,.4)) !important; }
  /* role badge pictures: still (role-badges.css already stops them) with their own red / blue / gold rim; the pulsing
     glow layer behind them (i.rk-halo) is left alone so admin / mod / VIP keep glowing in games too */
  html.snk-pc-game :is(.rk-admin, .rk-mod, .rk-vip):not(.rk-halo) { animation: none !important; filter: drop-shadow(0 0 1.5px rgb(var(--rgb, 255 255 255) / .95)) drop-shadow(0 0 4px rgb(var(--rgb, 255 255 255) / .55)) !important; }
  html.snk-pc-game .rk-sub { animation: none !important; filter: drop-shadow(0 0 2px rgba(255,255,255,.95)) drop-shadow(0 0 5px rgba(255,255,255,.7)) !important; }
}
