/* ============================================================
   Oblivion: rank crowns, donator gems and rank name colours.
   Moved out of the old theme.css unchanged: the gem animation, its
   timing and every size here are approved as they are.
   ============================================================ */

/* Rank icon in nav */
.rank-wrap{display:none;align-items:center}
#rankIcon{height:26px;width:auto;vertical-align:middle}
#rankIcon.glow-owner,#rankIcon.glow-cm,#rankIcon.glow-admin,#rankIcon.glow-mod,#rankIcon.glow-support{height:13px}
/* Staff crowns are 13x11 OSRS sprites: keep the pixels sharp when scaled */
img[src*="ranks/crowns/"]{image-rendering:pixelated}

/* ===== RANK GLOW ANIMATIONS (shared) ===== */
/* Staff crowns pulse like the gems: the crown itself breathes brighter (filter brightness runs on the
   compositor, no repaint), no halo and no shadow. */
.glow-owner,.glow-admin,.glow-cm,.glow-mod,.glow-support{animation:rankPulse 2.6s ease-in-out infinite}
/* Donator gem badges (js/auth.js donorBadgeHtml). Everything that moves runs on the compositor: no
   script per frame, no layout, no repaint.
   - The gem: .gem-clip (13:11, overflow hidden) shows one cell of a strip of frames, the gem's
     -anim.png sheet (loop frames, then the still gem; 15px cells = 13px of art + a 1px transparent
     gutter each side, hence the 15/13 widths). Only the strip's transform moves, in steps().
     Every gem plays the game's rim run (16 x 80 ms).
   - The pulse: the gem itself breathes brighter (rankPulse, filter brightness on .gem-clip). No halo.
   .gem-off (scrolled off screen, set in js/auth.js) pauses both. Reduced motion: the still gem. */
@keyframes rankPulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.35)}}
@keyframes gemRun16{from{transform:translateX(0)}to{transform:translateX(-94.117647%)}}
.gem-badge{position:relative;display:inline-block;height:14px;aspect-ratio:13/11;vertical-align:-2px;line-height:0}
.gem-clip{position:relative;display:block;width:100%;height:100%;overflow:hidden;animation:rankPulse 2.6s ease-in-out infinite}
.gem-strip{display:block;height:100%;width:1961.5385%;margin-left:-7.6923%;background:no-repeat 0 0/100% 100%;image-rendering:pixelated;animation:gemRun16 1.28s steps(16) infinite}
.gem-off .gem-clip,.gem-off .gem-strip,.rank-crown.gem-off{animation-play-state:paused}
.gem-sapphire .gem-strip{background-image:url(../assets/images/ranks/crowns/web/sapphire-anim.png)}
.gem-emerald .gem-strip{background-image:url(../assets/images/ranks/crowns/web/emerald-anim.png)}
.gem-ruby .gem-strip{background-image:url(../assets/images/ranks/crowns/web/ruby-anim.png)}
.gem-diamond .gem-strip{background-image:url(../assets/images/ranks/crowns/web/diamond-anim.png)}
.gem-dragonstone .gem-strip{background-image:url(../assets/images/ranks/crowns/web/dragonstone-anim.png)}
.gem-onyx .gem-strip{background-image:url(../assets/images/ranks/crowns/web/onyx-anim.png)}
.gem-zenyte .gem-strip{background-image:url(../assets/images/ranks/crowns/web/zenyte-anim.png)}
.gem-oblivion .gem-strip{background-image:url(../assets/images/ranks/crowns/web/oblivion-anim.png)}
/* Forum list, byline and readers: the Oblivion gem without its white sparkle (a blob at that size) */
:is(.ri-inline,.ri-viewer) .gem-oblivion .gem-strip{background-image:url(../assets/images/ranks/crowns/web/oblivion-anim-forum.png)}
/* Rank row (js/auth.js rankIconsHtml): every rank a user holds, staff crown first, then the donator gem.
   Crowns and gems are both 13x11 art, so they share one height, always a whole multiple of the art's
   11 px (1x, 2x, 3x) so every art pixel stays square: ri-inline/ri-viewer/ri-nav/ri-hiscores 11 px
   (crisp 2x on high-density screens), ri-post 22 px, ri-profile 33 px. */
.rank-icons{display:inline-flex;align-items:center;gap:4px;height:11px;vertical-align:-1px;margin-right:6px;line-height:0;flex:none}
.rank-icons>.rank-crown,.rank-icons>.rank-gem{height:100%;width:auto;flex:none;margin:0;vertical-align:top;image-rendering:pixelated}
.rank-icons:empty{display:none}
.rank-icons.ri-post{height:22px;gap:7px;vertical-align:-5px;margin-right:8px}
.rank-icons.ri-nav{margin-right:0}
.rank-icons.ri-hiscores{height:22px;gap:7px;margin-right:0}
.rank-icons.ri-profile{height:33px;gap:12px;margin-right:0}
.glow-sapphire{--gem-rgb:40,80,220}
.glow-emerald{--gem-rgb:30,180,80}
.glow-ruby{--gem-rgb:215,30,60}
.glow-diamond{--gem-rgb:215,235,245}
.glow-dragonstone{--gem-rgb:165,70,210}
.glow-onyx{--gem-rgb:140,140,150}
.glow-zenyte{--gem-rgb:245,140,30}
.glow-oblivion{--gem-rgb:85,57,168}
@media (prefers-reduced-motion: reduce){
  .gem-clip,.glow-owner,.glow-admin,.glow-cm,.glow-mod,.glow-support{animation:none}
  .gem-strip{animation:none;transform:translateX(-94.117647%)}
}

/* Rank name colors */
.rank-owner{color:#4fd7a3 !important;text-shadow:0 0 8px rgba(79,215,163,.5)}
.rank-admin{color:#f2dea1 !important;text-shadow:0 0 8px rgba(242,222,161,.5)}
.rank-developer{color:#a78bfa !important;text-shadow:0 0 8px rgba(167,139,250,.6)}
.rank-cm{color:#f87171 !important;text-shadow:0 0 8px rgba(248,113,113,.6)}
.rank-mod{color:#a8d4ff !important;text-shadow:0 0 8px rgba(168,212,255,.6)}
.rank-support{color:#7dd3fc !important;text-shadow:0 0 6px rgba(125,211,252,.4)}
.rank-player{color:var(--text)}
