/* PUBX ARENA — Lightweight GPU Animation System (Frames, Ranks, Achievements, Rank Up) */
.fx-wrap { position: relative; display: inline-grid; place-items: center; }
.fx-avatar-core { width: 68%; height: 68%; border-radius: 50%; overflow: hidden; z-index: 1; background: #0d151d; }
.fx-avatar-core img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-frame-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none; object-fit: contain;
}

/* Tiered GPU-only effects (transform / opacity / filter) */
.fx-effect-shimmer::after,
.fx-effect-pro::after,
.fx-effect-legend::after,
.fx-effect-diamond::after,
.fx-effect-crown::after,
.fx-effect-ace::after,
.fx-effect-recon::after,
.fx-effect-storm::after {
  content: ""; position: absolute; inset: -4%; border-radius: 50%; pointer-events: none; z-index: 3;
}
.fx-effect-shimmer::after {
  background: conic-gradient(from 90deg, transparent 0 66%, #ffebac88 82%, transparent 95%);
  -webkit-mask: radial-gradient(farthest-side, transparent 72%, #000 77%);
  mask: radial-gradient(farthest-side, transparent 72%, #000 77%);
  animation: fx-spin 8s linear infinite;
}
.fx-effect-recon::after {
  background: conic-gradient(from 30deg, transparent 0 73%, #50f8d4a0 84%, transparent 96%);
  -webkit-mask: radial-gradient(farthest-side, transparent 71%, #000 77%);
  mask: radial-gradient(farthest-side, transparent 71%, #000 77%);
  animation: fx-spin 7s linear infinite;
}
.fx-effect-storm::after {
  box-shadow: 0 0 19px #397aff77, inset 0 0 10px #428aff77;
  animation: fx-pulse 2.8s ease-in-out infinite;
}
.fx-effect-diamond::after {
  background: radial-gradient(circle at 25% 25%, #8ce8ff66, transparent 35%), radial-gradient(circle at 75% 75%, #b5f3ff55, transparent 35%);
  animation: fx-pulse 2.8s ease-in-out infinite;
}
.fx-effect-crown::after {
  box-shadow: 0 0 18px #b977ff66, inset 0 0 10px #b977ff44;
  animation: fx-pulse 3.2s ease-in-out infinite;
}
.fx-effect-ace::after {
  box-shadow: 0 0 20px #ff7b3b70;
  animation: fx-pulse 2.2s ease-in-out infinite;
}
.fx-effect-legend::after {
  background: conic-gradient(from 0deg, transparent 0 78%, #ffe18b66 86%, transparent 94%);
  -webkit-mask: radial-gradient(farthest-side, transparent 74%, #000 76%);
  mask: radial-gradient(farthest-side, transparent 74%, #000 76%);
  animation: fx-spin 6s linear infinite;
}
.fx-effect-pro::after {
  background: conic-gradient(from 0deg, transparent 0 72%, #ffd77380 84%, transparent 95%);
  -webkit-mask: radial-gradient(farthest-side, transparent 74%, #000 76%);
  mask: radial-gradient(farthest-side, transparent 74%, #000 76%);
  animation: fx-spin 7s linear infinite;
}

/* Achievement Rarity Glow */
.ach-card {
  position: relative; padding: 14px; background: #121b24; border: 1px solid #3c4852;
  display: grid; gap: 6px; justify-items: center; text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.ach-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.ach-card.locked { filter: grayscale(0.9); opacity: 0.56; }
.ach-card.rarity-legendary, .ach-card.rarity-mythic { border-color: #eab963; box-shadow: inset 0 0 22px #eab9631c; }
.ach-card.rarity-mythic { border-color: #ffe270; background: radial-gradient(circle at top, #35230b, #0e141c); }
.ach-card.rarity-epic { border-color: #a973e8; }
.ach-card:not(.locked).rarity-legendary img,
.ach-card:not(.locked).rarity-mythic img { animation: fx-badge-breathe 3.6s ease-in-out infinite; }
.ach-card:not(.locked).rarity-mythic::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle at 50% 24%,#ffe5a820,transparent 60%);
  animation:fx-badge-aura 4s ease-in-out infinite;
}
.ach-card img.ach-svg { width: 42px; height: 42px; filter: drop-shadow(0 4px 10px rgba(242, 169, 0, .45)); }
.ach-card.locked img.ach-svg { filter: grayscale(1) opacity(.55); }
.ach-progress { width: 100%; height: 4px; background: #26313a; overflow: hidden; }
.ach-progress i { display: block; height: 100%; background: linear-gradient(90deg, #749464, var(--gold)); }

/* Cinematic Rank Up / Achievement Unlocked Reveal Overlay */
.reveal-overlay {
  position: fixed; inset: 0; z-index: 60; background: #05080ce8;
  display: grid; place-items: center; padding: 20px; text-align: center;
  animation: fx-fade-in 0.25s ease-out;
}
.reveal-box {
  max-width: 420px; width: 100%; padding: 28px 22px; background: linear-gradient(155deg, #1a2430, #0c1219);
  border: 2px solid var(--gold); box-shadow: 0 0 48px #eab96344;
  animation: fx-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

/* Low-RAM / Reduced-motion safeguard */
body.low-perf .fx-effect-legend::after,
body.low-perf .fx-effect-pro::after,
body.low-perf .fx-effect-shimmer::after,
body.low-perf .fx-effect-recon::after,
body.low-perf .fx-effect-storm::after,
body.low-perf .fx-effect-diamond::after,
body.low-perf .fx-effect-crown::after,
body.low-perf .fx-effect-ace::after { animation: none !important; }
body.low-perf .ach-card img, body.low-perf .ach-card::before { animation:none !important; }

@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-pulse { 50% { opacity: 0.45; transform: scale(1.03); } }
@keyframes fx-badge-breathe { 50% { transform:translateY(-3px) scale(1.045); } }
@keyframes fx-badge-aura { 50% { opacity:.45; } }
@keyframes fx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-pop { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fx-effect-legend::after, .fx-effect-pro::after, .fx-effect-diamond::after,
  .fx-effect-crown::after, .fx-effect-ace::after, .fx-effect-shimmer::after,
  .fx-effect-recon::after, .fx-effect-storm::after, .reveal-box,
  .ach-card img, .ach-card::before { animation: none !important; }
}
