/* v20 account badges (admin / mod / VIP / subscriber) on the top-left of the globe / mobile icon.
   Admin = red glow, Mod = electric blue glow, VIP = gold glow, Subscriber = no glow.
   v20 fixes:
   - Smooth on phones: the pulse no longer animates `filter: drop-shadow()` lists of changing length (the browser
     cannot blend those, so it snapped between keyframes). The glow is now a separate soft layer (<i class="rk rk-halo">,
     added next to the badge by iconRank / rankBadge) and only its opacity pulses, which the phone's GPU does by itself.
   - Visible on PC: the glow is bigger, always on at a low level and breathes up to full, instead of one faint 2 s flash
     every 5 s; VIP is gold because a white glow cannot show on the light-grey lobby panels.
   - The lobby / player list is rebuilt from scratch on every update, which restarts a CSS animation each time; the
     pulse phase is therefore taken from the clock (--ad, set inline in iconRank / rankBadge) so it carries on smoothly.
   - Badges are a few pixels bigger (PC 20px, phone 15px).
   Loaded last so it wins over older badge rules.
   Nov 2026: the glow stays on at every graphics setting (Auto / Low / Basic, lite mode, PC game screens, during shots):
   perf-lite.css must never pause, stop or recolour i.rk-halo. */

/* doubled class + html[data-theme] beats the old badge rules in theme.css (!important ones included),
   so the old admin/mod/VIP/subscriber icons no longer sit behind the new ones */
html[data-theme] :is(#players-pane, #side-players, body) .rk-admin.rk-admin { background-image: url("/icons/role-admin.png?v=v21") !important; }
html[data-theme] :is(#players-pane, #side-players, body) .rk-mod.rk-mod     { background-image: url("/icons/role-mod.png?v=v21") !important; }
html[data-theme] :is(#players-pane, #side-players, body) .rk-vip.rk-vip     { background-image: url("/icons/role-vip.png?v=v18") !important; }
html[data-theme] :is(#players-pane, #side-players, body) .rk-sub.rk-sub     { background-image: url("/icons/role-sub.png?v=v18") !important; }
html[data-theme] :is(#players-pane, #side-players, body) :is(.rk-admin, .rk-mod, .rk-vip, .rk-sub) { background-repeat: no-repeat !important; background-position: center !important; }

/* same size as the admin badge everywhere in the players lists */
html:not(#_r1) :is(#players-pane, #side-players):is(#players-pane, #side-players) :is(.user-row, .plist-row) .client :is(img.rk, .rk):is(.rk-admin, .rk-mod, .rk-vip, .rk-sub) {
  --s: var(--ul-adm, 17px) !important;
  width: var(--s) !important; height: var(--s) !important;
  max-width: var(--s) !important; max-height: var(--s) !important;
  background-size: var(--s) var(--s) !important;
  z-index: 7 !important;
}

/* a little bigger so the badge reads at a glance (all four types share --ul-adm) */
html body:not(.mobile) :is(#players-pane, #side-players) { --ul-adm: 20px; }
html body.mobile :is(#players-pane, #side-players) { --ul-adm: 15px; }

/* glow colours: --rgb = outer glow, --core = bright centre */
html:not(#_r1):not(#_r2) .rk-admin { --rgb: 255 40 30; --core: 255 135 115 }
html:not(#_r1):not(#_r2) .rk-mod   { --rgb: 0 140 255; --core: 135 215 255 }
html:not(#_r1):not(#_r2) .rk-vip   { --rgb: 255 168 0; --core: 255 236 140 }

/* the badge picture itself: no animation (the old rk-pulse in theme.css is switched off), just a steady thin rim */
html:not(#_r1):not(#_r2) img.rk:is(.rk-admin, .rk-mod, .rk-vip),
html.snk-lite:not(#_r1):not(#_r2) img.rk:is(.rk-admin, .rk-mod, .rk-vip) {
  animation: none !important;
  filter: drop-shadow(0 0 1.5px rgb(var(--rgb) / .95)) drop-shadow(0 0 4px rgb(var(--rgb) / .55));
}
html:not(#_r1):not(#_r2) *.rk-sub { animation: none !important; filter: none !important; }

/* the glow layer: same box and position as the badge (it carries the same rk + rk-admin/mod/vip classes, so every
   list rule in layout-final / pc-client-v9 / mobile-v7 places it exactly under the badge); only used inside the lists */
html:not(#_r1):not(#_r2) i.rk-halo { display: none !important; }
html:not(#_r1):not(#_r2):not(#_r3):not(#_r4) :is(#players-pane, #side-players, #mchat) .client i.rk-halo.rk-halo.rk-halo {
  display: block !important;
  background: radial-gradient(closest-side, rgb(var(--core) / .95) 0%, rgb(var(--rgb) / .8) 55%, rgb(var(--rgb) / .62) 100%) center / 100% 100% no-repeat !important;
  border-radius: 50% !important;
  box-shadow: 0 0 calc(var(--s) * .6) calc(var(--s) * .14) rgb(var(--rgb) / .8) !important;
  pointer-events: none !important;
  z-index: 2 !important;
  will-change: filter;
  animation: snkHalo 2.8s ease-in-out var(--ad, 0s) infinite !important; /* 2.8s = PERIOD in iconRank / rankBadge; --ad = clock phase set inline */
}
/* only opacity changes (as filter: opacity(), which pinned `opacity: 1 !important` list rules cannot block) */
@keyframes snkHalo {
  0%, 100% { filter: opacity(.3); }
  50%      { filter: opacity(1); }
}
@keyframes snkHaloSoft {
  0%, 100% { filter: opacity(.6); }
  50%      { filter: opacity(1); }
}

/* reduced motion (Windows "animation effects" off): keep a gentler fade, never freeze it (it is a slow fade, no movement) */
@media (prefers-reduced-motion: reduce) {
  html:not(#_r1):not(#_r2):not(#_r3):not(#_r4) :is(#players-pane, #side-players, #mchat) .client i.rk-halo.rk-halo.rk-halo { animation: snkHaloSoft 2.8s ease-in-out var(--ad, 0s) infinite !important; }
}

/* PC lobby players panel: keep the mute (and info) buttons inside the frame, clear of the curved bottom-right corner */
