/* Nightwave cosmetics fixes (v2.0)
   Loaded LAST on stats.html, leaderboard.html and rustneo-leaderboard.html so
   the Locker preview and the public boards always render identically.
   Every rule here fixes a cosmetic that did not match its description. */

/* ---------- shared animations ---------- */
@keyframes nwV2Shift{to{background-position:-250% 0}}
@keyframes nwV2Down{to{background-position:0 3em}}
@keyframes nwV2GlowWarm{0%,100%{text-shadow:0 0 5px #ff6d2b77}50%{text-shadow:0 0 3px #ffc08a,0 0 13px #ff6d2bdd}}
@keyframes nwV2Frost{0%,100%{text-shadow:0 0 7px #43d9ff99}35%{text-shadow:0 0 2px #fff,0 0 12px #8beaff}60%{text-shadow:0 0 9px #43d9ffcc}}
@keyframes nwV2Radiant{0%,100%{text-shadow:0 0 4px #fff,0 0 9px #ffc94c55}50%{text-shadow:0 0 7px #fff,0 0 18px #ffc94c,0 0 30px #ffb42888}}
@keyframes nwV2Glitch{
  0%,6%,13%,40%,47%,68%,74%,100%{transform:none;text-shadow:2px 0 #ff315f,-2px 0 #22e8ff}
  7%,9%{transform:translateX(3px);text-shadow:-4px 0 #ff315f,4px 0 #22e8ff}
  10%,12%{transform:translateX(-2px) skewX(-10deg);text-shadow:5px 0 #ff315f,-3px 0 #22e8ff}
  41%,43%{transform:translate(-3px,1px);text-shadow:4px 0 #ff315f,-5px 0 #22e8ff}
  44%,46%{transform:skewX(12deg);text-shadow:-3px 0 #ff315f,3px 0 #22e8ff}
  69%,73%{transform:translateY(-2px);text-shadow:0 2px #ff315f,0 -2px #22e8ff}}
@keyframes nwV2Orbit{
  0%,100%{text-shadow:2px 0 #ff315f,-2px 0 #21e9ff}
  25%{text-shadow:0 2px #ff315f,0 -2px #21e9ff}
  50%{text-shadow:-2px 0 #ff315f,2px 0 #21e9ff}
  75%{text-shadow:0 -2px #ff315f,0 2px #21e9ff}}
@keyframes nwV2Flicker{0%,100%{filter:drop-shadow(0 0 5px #ff4d19aa) brightness(1)}12%{filter:drop-shadow(0 0 9px #ff7a1fdd) brightness(1.25)}20%{filter:drop-shadow(0 0 4px #ff4d1988) brightness(.9)}47%{filter:drop-shadow(0 0 8px #ff6a1fcc) brightness(1.15)}63%{filter:drop-shadow(0 0 5px #ff4d19aa) brightness(.95)}81%{filter:drop-shadow(0 0 10px #ff8a2bee) brightness(1.3)}}
@keyframes nwV2Drift{0%,100%{background-position:0% 50%,100% 50%,0 0}50%{background-position:100% 50%,0% 50%,0 0}}
@keyframes nwV2NeonBadge{0%,100%{border-color:#46e9ff;box-shadow:0 0 6px #37e5ff,0 0 12px #37e5ff66,inset 0 0 6px #37e5ff44}50%{border-color:#ff56e0;box-shadow:0 0 6px #fa43da,0 0 12px #fa43da66,inset 0 0 6px #fa43da44}}
@keyframes nwV2Rails{0%,100%{box-shadow:inset 0 2px 0 #52edff,inset 0 -2px 0 #ff3559,0 0 10px #30ddff88}50%{box-shadow:inset 0 2px 0 #ff3559,inset 0 -2px 0 #52edff,0 0 10px #ff355988}}
@keyframes nwV2Shine{0%{background-position:160% 0,0 0}60%,100%{background-position:-60% 0,0 0}}
@keyframes nwV2Toxic{0%,100%{text-shadow:0 0 5px #3dff2e88}50%{text-shadow:0 0 4px #d6ff9a,0 0 14px #3dff2e,0 0 24px #3dff2e77}}
@keyframes nwV2Zap{0%,100%{text-shadow:0 0 4px #fff,0 0 10px #2ce1ff}8%{text-shadow:0 0 6px #fff,0 0 18px #2ce1ff,0 0 28px #276bff}14%{text-shadow:0 0 3px #fff,0 0 7px #2ce1ff88}52%{text-shadow:0 0 6px #fff,0 0 16px #2ce1ff,0 0 26px #276bff}58%{text-shadow:0 0 4px #fff,0 0 9px #2ce1ff}}
@keyframes nwV2Snap{0%{opacity:1;transform:rotate(0)}24%{opacity:.15}25%{opacity:1;transform:rotate(47deg)}49%{opacity:.2}50%{opacity:1;transform:rotate(131deg)}74%{opacity:.1}75%{opacity:1;transform:rotate(212deg)}100%{opacity:.2;transform:rotate(212deg)}}
@property --nwv2a{syntax:"<angle>";inherits:false;initial-value:0deg}
@keyframes nwV2Spin{to{--nwv2a:360deg}}

/* ================= USERNAME FX ================= */
html body .pcfx-nfx_steel{background-image:linear-gradient(100deg,#93a6ae 0%,#e8f2f5 38%,#fff 50%,#e8f2f5 62%,#93a6ae 100%)!important;background-size:250% auto!important;color:transparent!important;-webkit-background-clip:text!important;background-clip:text!important;text-shadow:none!important;filter:drop-shadow(0 0 4px #dff6ff55)!important;animation:nwV2Shift 3.4s linear infinite!important}
html body .pcfx-nfx_scrapglow{color:#f49a59!important;animation:nwV2GlowWarm 2.6s ease-in-out infinite!important}
html body .pcfx-nfx_frost{color:#c4f6ff!important;animation:nwV2Frost 2.4s ease-in-out infinite!important}
html body .pcfx-nfx_glitch{display:inline-block!important;color:#fff!important;animation:nwV2Glitch 2s steps(1,end) infinite!important}
html body .pcfx-nfx_rgbshift{color:#fff!important;animation:nwV2Orbit 1.6s linear infinite!important}
html body .pcfx-nfx_inferno{text-shadow:none!important;animation:nwV2Flicker 1.3s linear infinite!important}
html body .pcfx-nfx_blooddrip{background-image:linear-gradient(180deg,#e0213d 0,#ff4a5e 1em,#ffd0d5 1.45em,#ff4a5e 1.9em,#e0213d 3em)!important;background-size:100% 3em!important;background-repeat:repeat!important;color:transparent!important;-webkit-background-clip:text!important;background-clip:text!important;text-shadow:none!important;filter:drop-shadow(0 0 5px #ff293f88)!important;animation:nwV2Down 2.8s linear infinite!important}
html body .pcfx-nfx_icevein{background-image:linear-gradient(100deg,#bfefff 0%,#d8fbff 40%,#fff 50%,#d8fbff 60%,#bfefff 100%)!important;background-size:250% auto!important;color:transparent!important;-webkit-background-clip:text!important;background-clip:text!important;text-shadow:none!important;filter:drop-shadow(0 0 5px #5ddfff99)!important;animation:nwV2Shift 4.5s linear infinite!important}
html body .pcfx-nfx_radiant{color:#fff6cc!important;filter:none!important;animation:nwV2Radiant 1.6s ease-in-out infinite!important}

/* ================= NAME PLATES ================= */
html body .pcplate-plate_steel{background:repeating-linear-gradient(90deg,rgba(255,255,255,.045) 0 1px,transparent 1px 3px),linear-gradient(180deg,#2c3a42,#10181d)!important}
html body .pcplate-plate_scrap{background:
  radial-gradient(circle at 7px 50%,#e0b07a 0 1.6px,#3a2518 2.4px,transparent 3px),
  radial-gradient(circle at calc(100% - 7px) 50%,#e0b07a 0 1.6px,#3a2518 2.4px,transparent 3px),
  linear-gradient(145deg,#56331f,#1d1713)!important}
html body .pcplate-plate_riveted{background:
  radial-gradient(circle at 6px 6px,#b9c1c4 0 1.4px,#202426 2.2px,transparent 2.8px),
  radial-gradient(circle at calc(100% - 6px) 6px,#b9c1c4 0 1.4px,#202426 2.2px,transparent 2.8px),
  radial-gradient(circle at 6px calc(100% - 6px),#b9c1c4 0 1.4px,#202426 2.2px,transparent 2.8px),
  radial-gradient(circle at calc(100% - 6px) calc(100% - 6px),#b9c1c4 0 1.4px,#202426 2.2px,transparent 2.8px),
  linear-gradient(#34383a,#171a1b)!important}
html body .pcplate-plate_viking{background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath d='M6 1v14M6 6 1.5 1.5M6 6l4.5-4.5' stroke='%23ffd27a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") 3px 50%/7px 11px no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath d='M6 1v14M6 6 1.5 1.5M6 6l4.5-4.5' stroke='%23ffd27a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") calc(100% - 3px) 50%/7px 11px no-repeat,
  linear-gradient(180deg,#302b29,#121212)!important;
  box-shadow:inset 0 0 8px #e0b66d33,0 0 6px #e0b66d33!important}
html body [class].pcplate-plate_viking.pcplate-plate_viking,html body #nw-total-conversion-root .pcplate-plate_viking{padding-left:22px!important;padding-right:22px!important}
html body .pcplate-plate_void{background-image:radial-gradient(ellipse at center,#7a46d8aa,transparent 55%),radial-gradient(ellipse at center,#3a1f7acc,transparent 60%),linear-gradient(#100c1b,#100c1b)!important;background-size:60% 160%,70% 180%,100% 100%!important;background-repeat:no-repeat!important;animation:nwV2Drift 6s ease-in-out infinite!important}
html body .pcplate-plate_terminal{background:repeating-linear-gradient(0deg,rgba(0,0,0,.28) 0 1px,transparent 1px 3px),linear-gradient(180deg,#2c3d2d,#101c14)!important}

/* ================= AVATAR FRAMES (square avatars) =================
   Wasteland UI uses square avatars. Rotating frames used to spin a whole
   square layer; now the energy travels around a ring that hugs the avatar. */
html body .nw-avatar-square .pcframe-frame_neon::before,
html body .nw-avatar-square .pcframe-frame_void::before,
html body .nw-avatar-square .pcframe-frame_cosmic::before,
html body .nw-avatar-square .pcframe-frame_portal::before,
html body .nw-avatar-square .pcframe-frame_nightwave::before,
html body .nw-avatar-square .pcframe-frame_nightwaveelite::before,
html body .nw-avatar-square .pcframe-frame_diamondcore::before{
  content:""!important;position:absolute!important;inset:-6px!important;border-radius:8px!important;border:0!important;box-shadow:none!important;clip-path:none!important;filter:none!important;
  transform:none!important;padding:3px!important;opacity:1!important;
  background:conic-gradient(from var(--nwv2a),var(--r1),var(--r2) 25%,var(--r1) 50%,var(--r3) 75%,var(--r1))!important;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0)!important;-webkit-mask-composite:xor!important;
  mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)!important;
  animation:nwV2Spin var(--sp,3s) linear infinite!important;pointer-events:none!important;z-index:3!important}
html body .nw-avatar-square .pcframe-frame_neon::after,
html body .nw-avatar-square .pcframe-frame_void::after,
html body .nw-avatar-square .pcframe-frame_cosmic::after,
html body .nw-avatar-square .pcframe-frame_portal::after,
html body .nw-avatar-square .pcframe-frame_nightwave::after,
html body .nw-avatar-square .pcframe-frame_nightwaveelite::after,
html body .nw-avatar-square .pcframe-frame_diamondcore::after{
  content:""!important;position:absolute!important;inset:-6px!important;border-radius:8px!important;transform:none!important;animation:none!important;clip-path:none!important;
  background:none!important;border:0!important;-webkit-mask:none!important;mask:none!important;filter:none!important;
  box-shadow:0 0 10px var(--g1),0 0 18px var(--g2)!important;pointer-events:none!important;z-index:2!important}
html body .nw-avatar-square .pcframe-frame_neon{--r1:#42eaff;--r2:#ff4bdf;--r3:#ffffff;--g1:#42eaff88;--g2:#ff4bdf55;--sp:2.6s}
html body .nw-avatar-square .pcframe-frame_void{--r1:#160726;--r2:#a26cff;--r3:#d767ff;--g1:#8b4cff99;--g2:#3c146d;--sp:4s}
html body .nw-avatar-square .pcframe-frame_cosmic{--r1:#8eeaff;--r2:#fff;--r3:#b45cff;--g1:#8eeaff77;--g2:#b45cff66;--sp:3.4s}
html body .nw-avatar-square .pcframe-frame_portal{--r1:#2d1a8a;--r2:#8a5cff;--r3:#3fb6ff;--g1:#8a5cffaa;--g2:#3fb6ff66;--sp:1.8s}
html body .nw-avatar-square .pcframe-frame_nightwave{--r1:#3cecff;--r2:#0b1c26;--r3:#ff365e;--g1:#3cecff88;--g2:#ff365e55;--sp:2.4s}
html body .nw-avatar-square .pcframe-frame_nightwaveelite{--r1:#50efff;--r2:#fff;--r3:#ff3559;--g1:#50efffaa;--g2:#ff355977;--sp:1.9s}
html body .nw-avatar-square .pcframe-frame_diamondcore{--r1:#c7f5ff;--r2:#847dff;--r3:#f6d5ff;--g1:#c7f5ffaa;--g2:#847dff66;--sp:5s}

/* ================= AVATAR EFFECTS ================= */
/* Scrap Sparks: actually visible, snapping sparks */
html body .pcae-ae_scrapsparks{position:relative}
html body .pcae-ae_scrapsparks::after{
  content:""!important;position:absolute!important;inset:-9px!important;border-radius:inherit!important;pointer-events:none!important;z-index:4!important;
  -webkit-mask:none!important;mask:none!important;clip-path:none!important;filter:drop-shadow(0 0 3px #ff9a3c)!important;border:0!important;box-shadow:none!important;
  background:
    radial-gradient(circle at 12% 18%,#fff3c4 0 1.6px,transparent 2.6px),
    radial-gradient(circle at 88% 12%,#ffb347 0 1.8px,transparent 2.8px),
    radial-gradient(circle at 94% 78%,#fff3c4 0 1.3px,transparent 2.3px),
    radial-gradient(circle at 16% 90%,#ff7626 0 1.8px,transparent 2.8px),
    radial-gradient(circle at 52% 2%,#ffe08a 0 1.3px,transparent 2.3px),
    radial-gradient(circle at 2% 55%,#ffcf73 0 1.2px,transparent 2.2px)!important;
  animation:nwV2Snap .9s steps(1,end) infinite!important}
/* Cosmic Void on square avatars: keep the nebula hugging the avatar */
html body .nw-avatar-square.pcae-ae_cosmic::after,html body .nw-avatar-square .pcae-ae_cosmic::after{transform:none!important;animation:nwV2Pulse 3s ease-in-out infinite!important;inset:-8px!important;border-radius:10px!important}
html body .nw-avatar-square.pcae-ae_nightwave::before,html body .nw-avatar-square.pcae-ae_nightwave::after{inset:-8px!important;border-radius:10px!important}
@keyframes nwV2Pulse{0%,100%{opacity:.75;filter:brightness(1)}50%{opacity:1;filter:brightness(1.3)}}

/* ================= RANK BADGES ================= */
html body .pcrank-rank_neon{filter:none!important;background:#07151c!important;color:#f6fbff!important;animation:nwV2NeonBadge 2.4s ease-in-out infinite!important}
html body .pcrank-rank_skull{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23db4054' fill-opacity='.45' d='M12 2C6.5 2 3 5.6 3 10.2c0 2.6 1.2 4.6 3 5.8V19a1 1 0 0 0 1 1h1.5v-2h1.5v2h4v-2h1.5v2H17a1 1 0 0 0 1-1v-3c1.8-1.2 3-3.2 3-5.8C21 5.6 17.5 2 12 2Zm-4 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4Zm8 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z'/%3E%3C/svg%3E") center/auto 120% no-repeat,#190b0f!important}
html body .pcrank-rank_scrapshield{background:
  radial-gradient(circle at 5px 5px,#e0b07a 0 1.3px,#2a1a10 2px,transparent 2.6px),
  radial-gradient(circle at calc(100% - 5px) 5px,#e0b07a 0 1.3px,#2a1a10 2px,transparent 2.6px),
  radial-gradient(circle at 5px calc(100% - 5px),#e0b07a 0 1.3px,#2a1a10 2px,transparent 2.6px),
  radial-gradient(circle at calc(100% - 5px) calc(100% - 5px),#e0b07a 0 1.3px,#2a1a10 2px,transparent 2.6px),
  linear-gradient(145deg,#6c4329,#251b16)!important}
html body .pcrank-rank_diamond{background-image:linear-gradient(115deg,transparent 35%,rgba(255,255,255,.85) 50%,transparent 65%),linear-gradient(135deg,#c7f5ff,#847dff,#f6d5ff)!important;background-size:250% 100%,100% 100%!important;background-repeat:no-repeat!important;animation:nwV2Shine 2.8s ease-in-out infinite!important}
html body .pcrank-rank_goldingot{background-image:linear-gradient(115deg,transparent 35%,rgba(255,255,240,.9) 50%,transparent 65%),linear-gradient(135deg,#8b5910,#ffe278,#a86e13)!important;background-size:250% 100%,100% 100%!important;background-repeat:no-repeat!important;animation:nwV2Shine 3.2s ease-in-out infinite!important}
html body .pcrank-rank_nightwave{background-size:250% 100%!important;animation:nwV2Shift 3s linear infinite,nwV2Rails 1.8s ease-in-out infinite!important}

/* ================= WAGER FX ================= */
html body .pcwager-wfx_toxic{color:#a6ff45!important;filter:none!important;animation:nwV2Toxic 1.8s ease-in-out infinite!important}
html body .pcwager-wfx_electric{color:#e9fdff!important;filter:none!important;animation:nwV2Zap 1.1s linear infinite!important}
html body .pcwager-wfx_scrap{background-image:linear-gradient(100deg,#b88a62 0%,#e9c696 35%,#fff6df 50%,#e9c696 65%,#b88a62 100%)!important;background-size:250% auto!important;color:transparent!important;-webkit-background-clip:text!important;background-clip:text!important;text-shadow:none!important;filter:drop-shadow(0 0 4px #ffb16188)!important;animation:nwV2Shift 2.4s linear infinite!important}

@media (prefers-reduced-motion:reduce){
  html body [class*="pcfx-"],html body [class*="pcplate-"],html body [class*="pcrank-"],html body [class*="pcwager-"],
  html body [class*="pcframe-"]::before,html body [class*="pcae-"]::after{animation-duration:6s!important}
}
/* Viking Rune: leaderboard pads the inner link, not the plate */
html body #nw-total-conversion-root .pcplate-plate_viking>a,html body #nw-total-conversion-root .pcplate-plate_viking>span,html body .pcplate-plate_viking>.nw-tc-name{padding-left:22px!important;padding-right:22px!important}
/* Skull Mark: stamp sits right of the number so it stays readable on small badges */
html body .pcrank-rank_skull{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ff5a6e' d='M12 2C6.5 2 3 5.6 3 10.2c0 2.6 1.2 4.6 3 5.8V19a1 1 0 0 0 1 1h1.5v-2h1.5v2h4v-2h1.5v2H17a1 1 0 0 0 1-1v-3c1.8-1.2 3-3.2 3-5.8C21 5.6 17.5 2 12 2Zm-4 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4Zm8 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z'/%3E%3C/svg%3E") right 5px center/11px 11px no-repeat,#190b0f!important;padding-right:20px!important}
